-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added my fork from https://github.com/Place1/swagger-codegen-typescript-browser * ran bin/typescript-fetch-petstore-all.sh * use FormData.append rather than .set for IE11 compat * reverted change to licenseInfo.mustache * reverted some comments * added package.json and tsconfig.json back to the generator * added support for blob (application/octet-stream) responses * models and apis are now in folders * added support for modelPropertyNaming based on the spec * bug fix * updated samples * Restore pom.xml for typescript project * Restore samples/client/petstore/typescript-fetch/tests/default/package.json ≈ * added support for response type Date conversion * updated samples * Rework pom in "samples.ci" * Restore "samples/client/petstore/typescript-fetch/tests/default" * updated configuration class to use property getters to allow clients to implement configuration values as getters * added {{datatype}}ToJSON functions to handle serialization and naming conversions * fixed missing import * fixed compilation error. updated samples * 1 character change to get CI to run again * updated samples * added support for array type request body * updated tests * support for optional request bodies * updated models json converters to handle undefined inputs (to simplify usage in optional contexts like optional request bodies) * updated samples * updated tests * changed to typescript version 2.4 * updated samples * support for optional properties being null, undefined or omitted * updated samples * bug fix * bug fix * updated samples * ran npm install in test project * patch to get tests running * added support for retrieving raw response. added support for binary request bodies. added support for blob data type for files/binary.
- Loading branch information
Showing
133 changed files
with
11,386 additions
and
8,643 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
CI/samples.ci/client/petstore/typescript-fetch/builds/default/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>TypeScriptAngularBuildPestoreClientTests</artifactId> | ||
<packaging>pom</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>TS Fetch Default Petstore Client</name> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>copy-dependencies</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
59 changes: 59 additions & 0 deletions
59
CI/samples.ci/client/petstore/typescript-fetch/builds/es6-target/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>TypeScriptAngularBuildES6PestoreClientTests</artifactId> | ||
<packaging>pom</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>TS Fetch ES6 Petstore Client</name> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>copy-dependencies</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.2.1</version> | ||
<executions> | ||
<execution> | ||
<id>npm-install</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>npm</executable> | ||
<arguments> | ||
<argument>install</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>npm-test</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>npm</executable> | ||
<arguments> | ||
<argument>test</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
73 changes: 73 additions & 0 deletions
73
CI/samples.ci/client/petstore/typescript-fetch/builds/with-npm-version/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>TypeScriptAngularBuildWithNPMVersionPestoreClientTests</artifactId> | ||
<packaging>pom</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>TS Fetch Petstore Client (with npm)</name> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>copy-dependencies</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.2.1</version> | ||
<executions> | ||
<execution> | ||
<id>npm-install</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>npm</executable> | ||
<arguments> | ||
<argument>install</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>npm-build</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>npm</executable> | ||
<arguments> | ||
<argument>run</argument> | ||
<argument>build</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>npm-test</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>npm</executable> | ||
<arguments> | ||
<argument>test</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
59 changes: 59 additions & 0 deletions
59
CI/samples.ci/client/petstore/typescript-fetch/tests/default/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>TypeScriptFetchPestoreClientTests</artifactId> | ||
<packaging>pom</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>TS Fetch Petstore Test Client</name> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>copy-dependencies</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.2.1</version> | ||
<executions> | ||
<execution> | ||
<id>npm-install</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>npm</executable> | ||
<arguments> | ||
<argument>install</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>npm-test</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>npm</executable> | ||
<arguments> | ||
<argument>test</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
1 change: 1 addition & 0 deletions
1
.../src/Org.OpenAPITools.Test/obj/Debug/Org.OpenAPITools.Test.csproj.CoreCompileInputs.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
c2fcc2ae9693a8e8d02b25e286844aad88188fcb |
Binary file added
BIN
+5.75 KB
...rg.OpenAPITools.Test/obj/Debug/Org.OpenAPITools.Test.csprojResolveAssemblyReference.cache
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 131 additions & 0 deletions
131
...gradle-plugin/bin/main/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
/* | ||
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.openapitools.generator.gradle.plugin | ||
|
||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.invoke | ||
import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorGenerateExtension | ||
import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorMetaExtension | ||
import org.openapitools.generator.gradle.plugin.extensions.OpenApiGeneratorValidateExtension | ||
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask | ||
import org.openapitools.generator.gradle.plugin.tasks.GeneratorsTask | ||
import org.openapitools.generator.gradle.plugin.tasks.MetaTask | ||
import org.openapitools.generator.gradle.plugin.tasks.ValidateTask | ||
|
||
/** | ||
* A plugin providing common Open API Generator use cases. | ||
* | ||
* @author Jim Schubert | ||
*/ | ||
@Suppress("unused") | ||
class OpenApiGeneratorPlugin : Plugin<Project> { | ||
override fun apply(project: Project) { | ||
project.run { | ||
val meta = extensions.create( | ||
"openApiMeta", | ||
OpenApiGeneratorMetaExtension::class.java, | ||
project | ||
) | ||
|
||
val validate = extensions.create( | ||
"openApiValidate", | ||
OpenApiGeneratorValidateExtension::class.java, | ||
project | ||
) | ||
|
||
val generate = extensions.create( | ||
"openApiGenerate", | ||
OpenApiGeneratorGenerateExtension::class.java, | ||
project | ||
) | ||
|
||
generate.outputDir.set("$buildDir/generate-resources/main") | ||
|
||
tasks { | ||
"openApiGenerators"(GeneratorsTask::class) { | ||
group = pluginGroup | ||
description = "Lists generators available via Open API Generators." | ||
} | ||
"openApiMeta"(MetaTask::class) { | ||
group = pluginGroup | ||
description = "Generates a new generator to be consumed via Open API Generator." | ||
|
||
generatorName.set(meta.generatorName) | ||
packageName.set(meta.packageName) | ||
outputFolder.set(meta.outputFolder) | ||
} | ||
"openApiValidate"(ValidateTask::class) { | ||
group = pluginGroup | ||
description = "Validates an Open API 2.0 or 3.x specification document." | ||
|
||
inputSpec.set(validate.inputSpec) | ||
} | ||
"openApiGenerate"(GenerateTask::class) { | ||
group = pluginGroup | ||
description = "Generate code via Open API Tools Generator for Open API 2.0 or 3.x specification documents." | ||
|
||
verbose.set(generate.verbose) | ||
validateSpec.set(generate.validateSpec) | ||
generatorName.set(generate.generatorName) | ||
outputDir.set(generate.outputDir) | ||
inputSpec.set(generate.inputSpec) | ||
templateDir.set(generate.templateDir) | ||
auth.set(generate.auth) | ||
systemProperties.set(generate.systemProperties) | ||
configFile.set(generate.configFile) | ||
skipOverwrite.set(generate.skipOverwrite) | ||
apiPackage.set(generate.apiPackage) | ||
modelPackage.set(generate.modelPackage) | ||
modelNamePrefix.set(generate.modelNamePrefix) | ||
modelNameSuffix.set(generate.modelNameSuffix) | ||
instantiationTypes.set(generate.instantiationTypes) | ||
typeMappings.set(generate.typeMappings) | ||
additionalProperties.set(generate.additionalProperties) | ||
languageSpecificPrimitives.set(generate.languageSpecificPrimitives) | ||
importMappings.set(generate.importMappings) | ||
invokerPackage.set(generate.invokerPackage) | ||
groupId.set(generate.groupId) | ||
id.set(generate.id) | ||
version.set(generate.version) | ||
library.set(generate.library) | ||
gitUserId.set(generate.gitUserId) | ||
gitRepoId.set(generate.gitRepoId) | ||
releaseNote.set(generate.releaseNote) | ||
httpUserAgent.set(generate.httpUserAgent) | ||
reservedWordsMappings.set(generate.reservedWordsMappings) | ||
ignoreFileOverride.set(generate.ignoreFileOverride) | ||
removeOperationIdPrefix.set(generate.removeOperationIdPrefix) | ||
apiFilesConstrainedTo.set(generate.apiFilesConstrainedTo) | ||
modelFilesConstrainedTo.set(generate.modelFilesConstrainedTo) | ||
supportingFilesConstrainedTo.set(generate.supportingFilesConstrainedTo) | ||
generateModelTests.set(generate.generateModelTests) | ||
generateModelDocumentation.set(generate.generateModelDocumentation) | ||
generateApiTests.set(generate.generateApiTests) | ||
generateApiDocumentation.set(generate.generateApiDocumentation) | ||
withXml.set(generate.withXml) | ||
configOptions.set(generate.configOptions) | ||
} | ||
} | ||
} | ||
} | ||
|
||
companion object { | ||
const val pluginGroup = "OpenAPI Tools" | ||
} | ||
} | ||
|
Oops, something went wrong.