diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7b813eb0c3c8..234b773ab9b2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,5 +16,5 @@ These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`. For Windows users, please run the script in [Git BASH](https://gitforwindows.org/). -- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `5.3.x`, `6.0.x` +- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (5.3.0), `6.0.x` - [ ] If your PR is targeting a particular programming language, @mention the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) members, so they are more likely to review the pull request. diff --git a/.gitignore b/.gitignore index 9ce6c04e156d..e72b71f24d1f 100644 --- a/.gitignore +++ b/.gitignore @@ -176,12 +176,15 @@ samples/client/petstore/python-tornado/.venv/ # PHP samples/client/petstore/php/OpenAPIClient-php/composer.lock +samples/client/petstore/php-dt/composer.lock +samples/client/petstore/php-dt-modern/composer.lock samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/composer.lock samples/server/petstore/php-laravel/lib/composer.lock samples/server/petstore/php-lumen/lib/composer.lock samples/server/petstore/php-slim4/composer.lock samples/server/petstore/php-symfony/SymfonyBundle-php/composer.lock samples/server/petstore/php-mezzio-ph/composer.lock +samples/server/petstore/php-mezzio-ph-modern/composer.lock # ts samples/client/petstore/typescript-angular2/npm/npm-debug.log diff --git a/README.md b/README.md index d4e2056ddde2..7db649d979a8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@
-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.2.1`): +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.3.0`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator) @@ -17,14 +17,6 @@ [![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/master?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67) [![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/openapitools/openapi-generator/Check%20Supported%20Java%20Versions/master?label=Check%20Supported%20Java%20Versions&logo=github&logoColor=green)](https://github.com/OpenAPITools/openapi-generator/actions?query=workflow%3A%22Check+Supported+Java+Versions%22) - -[5.3.x](https://github.com/OpenAPITools/openapi-generator/tree/5.3.x) (`5.3.x`): -[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/5.3.x.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) -[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/5.3.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) -[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=5.3.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator) -[![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/5.3.x)](https://cloud.drone.io/OpenAPITools/openapi-generator) -[![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/5.3.x?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67) - [6.0.x](https://github.com/OpenAPITools/openapi-generator/tree/6.0.x) (`6.0.x`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/6.0.x.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/6.0.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) @@ -76,7 +68,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0, .NET 5.0. Libraries: RestSharp, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) | -| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | +| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, [Mezzio (fka Zend Expressive)](https://github.com/mezzio/mezzio), Slim, Silex, [Symfony](https://symfony.com/)), **Python** (FastAPI, Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) | | **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** | | **Configuration files** | [**Apache2**](https://httpd.apache.org/) | | **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer**, **WSDL** | @@ -118,9 +110,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 | OpenAPI Generator Version | Release Date | Notes | | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- | | 6.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.0.0-SNAPSHOT/) | Nov/Dec 2021 | Minor release with breaking changes (no fallback) | -| 5.3.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.3.0-SNAPSHOT/) | Aug/Sep 2021 | Minor release with breaking changes (with fallback) | -| 5.2.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.2.1-SNAPSHOT/) | 09.08.2021 | Patch release (enhancements, bug fixes, etc) | -| [5.2.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.2.0) (latest stable release) | 09.07.2021 | Minor release with breaking changes (with fallback) | +| 5.3.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.3.0-SNAPSHOT/) | Sep/Oct 2021 | Minor release with breaking changes (with fallback) | +| [5.2.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.2.1) (latest stable release) | 016.08.2021 | Patch release (enhancements, bug fixes, etc) | | [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) | OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0 @@ -177,16 +168,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository. If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum): -JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.0/openapi-generator-cli-5.2.0.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.1/openapi-generator-cli-5.2.1.jar` For **Mac/Linux** users: ```sh -wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.0/openapi-generator-cli-5.2.0.jar -O openapi-generator-cli.jar +wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.1/openapi-generator-cli-5.2.1.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. ``` -Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.0/openapi-generator-cli-5.2.0.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.1/openapi-generator-cli-5.2.1.jar ``` After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. @@ -411,7 +402,7 @@ openapi-generator-cli version To use a specific version of "openapi-generator-cli" ```sh -openapi-generator-cli version-manager set 5.2.0 +openapi-generator-cli version-manager set 5.2.1 ``` Or install it as dev-dependency: @@ -435,7 +426,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat (if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`) -You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.0/openapi-generator-cli-5.2.0.jar) +You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.2.1/openapi-generator-cli-5.2.1.jar) To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate` @@ -905,6 +896,7 @@ Here is a list of template creators: * OCaml: @cgensoul * Perl: @wing328 [:heart:](https://www.patreon.com/wing328) * PHP (Guzzle): @baartosz + * PHP (with Data Transfer): @Articus * PowerShell: @beatcracker * PowerShell (refactored in 5.0.0): @wing328 * Python: @spacether @@ -963,10 +955,10 @@ Here is a list of template creators: * NodeJS Express: @YishTish * PHP Laravel: @renepardon * PHP Lumen: @abcsun + * PHP Mezzio (with Path Handler): @Articus * PHP Slim: @jfastnacht * PHP Slim4: @ybelenko * PHP Symfony: @ksm2 - * PHP Zend Expressive (with Path Handler): @Articus * Python FastAPI: @krjakbrjak * Python AIOHTTP: @Jyhess * Ruby on Rails 5: @zlx diff --git a/bin/configs/java-micronaut-client.yaml b/bin/configs/java-micronaut-client.yaml new file mode 100644 index 000000000000..31722943924c --- /dev/null +++ b/bin/configs/java-micronaut-client.yaml @@ -0,0 +1,9 @@ +generatorName: java-micronaut-client +outputDir: samples/client/petstore/java-micronaut-client/ +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + artifactId: petstore-micronaut + hideGenerationTimestamp: "true" + configureAuth: "false" + build: "all" + test: "spock" diff --git a/bin/configs/php-dt-modern.yaml b/bin/configs/php-dt-modern.yaml new file mode 100644 index 000000000000..33432079423a --- /dev/null +++ b/bin/configs/php-dt-modern.yaml @@ -0,0 +1,6 @@ +generatorName: php-dt +outputDir: samples/client/petstore/php-dt-modern +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/php-dt-modern +additionalProperties: + modern: "true" diff --git a/bin/configs/php-dt.yaml b/bin/configs/php-dt.yaml new file mode 100644 index 000000000000..6e1cbcccc57e --- /dev/null +++ b/bin/configs/php-dt.yaml @@ -0,0 +1,4 @@ +generatorName: php-dt +outputDir: samples/client/petstore/php-dt +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/php-dt diff --git a/bin/utils/release/release_version_update.sh b/bin/utils/release/release_version_update.sh index f57fd7b7daf2..a6f310fe2bd4 100755 --- a/bin/utils/release/release_version_update.sh +++ b/bin/utils/release/release_version_update.sh @@ -83,6 +83,8 @@ declare -a xml_files=( "${root}/modules/openapi-generator-maven-plugin/examples/java-client.xml" "${root}/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml" "${root}/modules/openapi-generator-maven-plugin/examples/non-java.xml" + "${root}/modules/openapi-generator-maven-plugin/examples/kotlin.xml" + "${root}/modules/openapi-generator-maven-plugin/examples/spring.xml" "${root}/pom.xml" ) diff --git a/docs/generators.md b/docs/generators.md index c71da0663ed5..f1e21a56dafe 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -36,6 +36,7 @@ The following generators are available: * [groovy](generators/groovy.md) * [haskell-http-client](generators/haskell-http-client.md) * [java](generators/java.md) +* [java-micronaut-client (beta)](generators/java-micronaut-client.md) * [javascript](generators/javascript.md) * [javascript-apollo (beta)](generators/javascript-apollo.md) * [javascript-closure-angular](generators/javascript-closure-angular.md) @@ -50,6 +51,7 @@ The following generators are available: * [ocaml](generators/ocaml.md) * [perl](generators/perl.md) * [php](generators/php.md) +* [php-dt (beta)](generators/php-dt.md) * [powershell (beta)](generators/powershell.md) * [python (experimental)](generators/python.md) * [python-legacy](generators/python-legacy.md) diff --git a/docs/generators/README.md b/docs/generators/README.md index a8ac9c9310c3..b9e8926f6647 100644 --- a/docs/generators/README.md +++ b/docs/generators/README.md @@ -39,6 +39,7 @@ The following generators are available: * [ocaml](ocaml.md) * [perl](perl.md) * [php](php.md) +* [php-dt](php-dt.md) * [powershell](powershell.md) * [python](python.md) * [python-legacy](python-legacy.md) diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 4cd2af16f909..858464a52e1e 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.api| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-groovy| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index 373bc61861b2..bb4d9dbb2365 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.controllers| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md new file mode 100644 index 000000000000..95e4cf76c367 --- /dev/null +++ b/docs/generators/java-micronaut-client.md @@ -0,0 +1,297 @@ +--- +title: Config Options for java-micronaut-client +sidebar_label: java-micronaut-client +--- + +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|apiPackage|package for generated api classes| |org.openapitools.api| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| +|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-micronaut| +|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|build|Specify for which build tool to generate files|
**gradle**
Gradle configuration is generated for the project
**all**
Both Gradle and Maven configurations are generated
**maven**
Maven configuration is generated for the project
|all| +|configPackage|Configuration package for generated code| |org.openapitools.configuration| +|configureAuth|Configure all the authorization methods as specified in the file| |false| +|developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| +|developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| +|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|invokerPackage|root package for generated code| |org.openapitools| +|java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
**true**
Use Java 8 classes such as Base64
**false**
Various third party libraries as needed
|true| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| +|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|snapshotVersion|Uses a SNAPSHOT version.|
**true**
Use a SnapShot Version
**false**
Use a Release Version
|null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|sourceFolder|source folder for generated code| |src/main/java| +|test|Specify which test tool to generate files for|
**junit**
Use JUnit as test tool
**spock**
Use Spock as test tool
|junit| +|title|Client service name| |OpenAPI Micronaut Client| +|useBeanValidation|Use BeanValidation API annotations| |true| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | +|Array|java.util.List| +|ArrayList|java.util.ArrayList| +|BigDecimal|java.math.BigDecimal| +|Date|java.util.Date| +|DateTime|org.joda.time.*| +|File|java.io.File| +|HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| +|Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|ArrayList| +|map|HashMap| +|set|LinkedHashSet| + + +## LANGUAGE PRIMITIVES + + + +## RESERVED WORDS + + + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Array|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✓|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✗|OAS2,OAS3 +|Union|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✓|OAS3 +|BearerToken|✗|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✓|OAS2,OAS3 +|OAuth2_ClientCredentials|✓|OAS2,OAS3 +|OAuth2_AuthorizationCode|✓|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index e0d62c36cd7a..cddf3dde0b7d 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index be689abd329b..073b381962c9 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |com.prokarma.pkmst.controller| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index 3f926d08a2d1..f7bf3373c7f7 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |controllers| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 9b70a6763f5a..77d069151bdc 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |null| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 78118f1a4d7a..1c14df7a90f9 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.vertxweb.server.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index c1b480b012a3..78b0508c01d4 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.server.api.verticle| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/java.md b/docs/generators/java.md index 6de9ed101b0a..df346d5e8d50 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.client.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index 7cd7ed52c80a..b604285fdbf3 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index fb3547c920d8..36393f588aae 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 39c9dcba665b..b8e1da73614d 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ------ | ----------- | ------ | ------- | |addConsumesProducesJson|Add @Consumes/@Produces Json to API interface| |false| |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 915ec4a96b16..5958bcdd2eca 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -9,7 +9,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ------ | ----------- | ------ | ------- | |addConsumesProducesJson|Add @Consumes/@Produces Json to API interface| |false| |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index e79a378b7be6..076d72881e30 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index c7b5fdd5c1ec..ed99a6037ef7 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index 4be73c6a6d1a..e7e1a5fd228a 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 1b0425bdfc00..3f7e3c6de57c 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |org.openapitools.api| |artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| diff --git a/docs/generators/php-dt.md b/docs/generators/php-dt.md new file mode 100644 index 000000000000..a61f3cd351c3 --- /dev/null +++ b/docs/generators/php-dt.md @@ -0,0 +1,243 @@ +--- +title: Config Options for php-dt +sidebar_label: php-dt +--- + +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|apiPackage|package for generated api classes| |null| +|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|modelPackage|package for generated models| |null| +|modern|use modern language features (generated code will require PHP 8.0)| |false| +|packageName|The main package name for classes. e.g. GeneratedPetstore| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|srcBasePath|The directory to serve as source root.| |null| +|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|array| +|map|array| + + +## LANGUAGE PRIMITIVES + + + +## RESERVED WORDS + + + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Array|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✓|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✗|OAS2,OAS3 +|Union|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✗|OAS2,OAS3 +|ApiKey|✗|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✗|OAS3 +|OAuth2_Implicit|✗|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✗|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 43614a0a5aa0..b5033cd4fef0 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -8,7 +8,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiFirst|Generate the API from the OAI spec at server compile time (API first approach)| |false| |apiPackage|package for generated api classes| |org.openapitools.api| diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index ecf3c56c4e4a..b8a76737e321 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.2.1-SNAPSHOT + 5.3.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index 81f86e9cb343..558f9ab56e7c 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -6,7 +6,7 @@ openapi-generator-project org.openapitools - 5.2.1-SNAPSHOT + 5.3.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index 2a71ae5459af..4c303de9b366 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,5 +1,5 @@ # RELEASE_VERSION -openApiGeneratorVersion=5.2.1-SNAPSHOT +openApiGeneratorVersion=5.3.0-SNAPSHOT # /RELEASE_VERSION # BEGIN placeholders diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index 11cb549c1956..a21ff37cbd8c 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.2.1-SNAPSHOT + 5.3.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index 368c2a895315..5a559d77aba2 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 5.2.1-SNAPSHOT + 5.3.0-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/examples/kotlin.xml b/modules/openapi-generator-maven-plugin/examples/kotlin.xml index 6db0f049f2a0..facba8edeb3f 100644 --- a/modules/openapi-generator-maven-plugin/examples/kotlin.xml +++ b/modules/openapi-generator-maven-plugin/examples/kotlin.xml @@ -15,7 +15,7 @@ org.openapitools openapi-generator-maven-plugin - 5.2.1-SNAPSHOT + 5.3.0-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml index 2e0ad09aeeee..693b2a6f431c 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml @@ -19,7 +19,7 @@ org.openapitools openapi-generator-maven-plugin - 5.2.1-SNAPSHOT + 5.3.0-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml index a478bbb8527c..a2408e81815c 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 5.2.1-SNAPSHOT + 5.3.0-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml index 56620b71e13e..3dd66f500def 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 5.2.1-SNAPSHOT + 5.3.0-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/examples/spring.xml b/modules/openapi-generator-maven-plugin/examples/spring.xml index 79b8942ae57a..651a0e187a9d 100644 --- a/modules/openapi-generator-maven-plugin/examples/spring.xml +++ b/modules/openapi-generator-maven-plugin/examples/spring.xml @@ -20,7 +20,7 @@ org.openapitools openapi-generator-maven-plugin - 5.2.1-SNAPSHOT + 5.3.0-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 9252181f3f84..e5908b39f821 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.openapitools openapi-generator-project - 5.2.1-SNAPSHOT + 5.3.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java index 8949156f4d8e..1f1dbd946f51 100644 --- a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java +++ b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java @@ -458,7 +458,7 @@ public void execute() throws MojoExecutionException { } } - if (Boolean.TRUE.equals(skipIfSpecIsUnchanged) && inputSpecFile.exists()) { + if (Boolean.TRUE.equals(skipIfSpecIsUnchanged)) { File storedInputSpecHashFile = getHashFile(inputSpecFile); if (storedInputSpecHashFile.exists()) { String inputSpecHash = null; diff --git a/modules/openapi-generator-maven-plugin/src/test/java/org/openapitools/codegen/plugin/CodeGenMojoTest.java b/modules/openapi-generator-maven-plugin/src/test/java/org/openapitools/codegen/plugin/CodeGenMojoTest.java index ad69be7e7209..dd2083d017e3 100644 --- a/modules/openapi-generator-maven-plugin/src/test/java/org/openapitools/codegen/plugin/CodeGenMojoTest.java +++ b/modules/openapi-generator-maven-plugin/src/test/java/org/openapitools/codegen/plugin/CodeGenMojoTest.java @@ -16,6 +16,13 @@ package org.openapitools.codegen.plugin; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Comparator; +import java.util.Map; + import org.apache.commons.io.FileUtils; import org.apache.maven.execution.DefaultMavenExecutionRequest; import org.apache.maven.execution.MavenExecutionRequest; @@ -25,12 +32,6 @@ import org.apache.maven.project.ProjectBuilder; import org.apache.maven.project.ProjectBuildingRequest; import org.eclipse.aether.DefaultRepositorySystemSession; -import org.openapitools.codegen.plugin.stubs.StubUtility; - -import java.io.File; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Map; public class CodeGenMojoTest extends BaseTestCase { @Override @@ -67,6 +68,87 @@ public void testHashGenerationFileContainsExecutionId() throws Exception { assertTrue(hashFolder.resolve("petstore.yaml-executionId.sha256").toFile().exists()); } + /** + * For a Pom file which refers to a input file which will be on the classpath, as opposed to a file path, + * test that the spec is not regenerated when the hash has not changed. + * + * @throws Exception + */ + public void testSkipRegenerationForClasspathSpecFileNoChange() throws Exception { + + //GIVEN + /* Setup the mojo */ + final Path folder = Files.createTempDirectory("test-classpath"); + final CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/classpath", "executionId"); + + /* Perform an initial generation */ + mojo.execute(); + + /* Check the hash file was created */ + final Path hashFolder = folder.resolve("target/generated-sources/common-maven/remote-openapi/.openapi-generator"); + assertTrue(hashFolder.resolve("petstore-on-classpath.yaml-executionId.sha256").toFile().exists()); + + /* Remove the generated source */ + Files.walk(folder.resolve("target/generated-sources/common-maven/remote-openapi/src")) + .sorted(Comparator.reverseOrder()) + .map(Path::toFile) + .forEach(File::delete); + + + // WHEN + /* Execute the mojo again */ + mojo.execute(); + + // THEN + /* Verify that the source directory has not been repopulated. If it has then we generated code again */ + assertFalse("src directory should not have been regenerated", + folder.resolve("target/generated-sources/common-maven/remote-openapi/src").toFile().exists()); + + } + + /** + * For a Pom file which refers to a input file which will be on the classpath, as opposed to a file path, + * test that the generated source is regenerated when the hash has changed. + * + * @throws Exception + */ + public void testSkipRegenerationForClasspathSpecFileWithChange() throws Exception { + + //GIVEN + /* Setup the mojo */ + final Path folder = Files.createTempDirectory("test-classpath"); + final CodeGenMojo mojo = loadMojo(folder.toFile(), "src/test/resources/classpath", "executionId"); + + /* Perform an initial generation */ + mojo.execute(); + + /* Check the hash file was created, proving a generation occurred */ + final Path hashFolder = folder.resolve("target/generated-sources/common-maven/remote-openapi/.openapi-generator"); + assertTrue(hashFolder.resolve("petstore-on-classpath.yaml-executionId.sha256").toFile().exists()); + + /* Update the hash contents to be a different value, simulating a spec change */ + Files.write( + hashFolder.resolve("petstore-on-classpath.yaml-executionId.sha256"), + Arrays.asList("bd1bf4a953c858f9d47b67ed6029daacf1707e5cbd3d2e4b01383ba30363366f")); + + /* Remove the generated source */ + Files.walk(folder.resolve("target/generated-sources/common-maven/remote-openapi/src")) + .sorted(Comparator.reverseOrder()) + .map(Path::toFile) + .forEach(File::delete); + + + // WHEN + /* Execute the mojo again */ + mojo.execute(); + + // THEN + /* Verify that the source directory has not been repopulated. If it has then we generated code again */ + assertTrue("src directory should have been regenerated", + folder.resolve("target/generated-sources/common-maven/remote-openapi/src").toFile().exists()); + + } + protected CodeGenMojo loadMojo(File temporaryFolder, String projectRoot) throws Exception { return loadMojo(temporaryFolder, projectRoot, "default"); } diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/classpath/pom.xml b/modules/openapi-generator-maven-plugin/src/test/resources/classpath/pom.xml new file mode 100644 index 000000000000..6a841479f9d9 --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/test/resources/classpath/pom.xml @@ -0,0 +1,59 @@ + + + + 4.0.0 + common.maven + common-maven + jar + 1.0.0-SNAPSHOT + OpenAPI Generator Configuration Test + https://openapi-generator.tech/ + + common-maven + + + org.openapitools + openapi-generator-maven-plugin + + + petstore-on-classpath.yaml + java + + true + + + joda + + jersey2 + ${basedir}/target/generated-sources/common-maven/remote-openapi + remote.org.openapitools.client.api + remote.org.openapitools.client.model + remote.org.openapitools.client + + + + executionId + generate-sources + + generate + + + + + + + \ No newline at end of file diff --git a/modules/openapi-generator-maven-plugin/src/test/resources/petstore-on-classpath.yaml b/modules/openapi-generator-maven-plugin/src/test/resources/petstore-on-classpath.yaml new file mode 100644 index 000000000000..f5e98eec38da --- /dev/null +++ b/modules/openapi-generator-maven-plugin/src/test/resources/petstore-on-classpath.yaml @@ -0,0 +1,736 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: >- + This is a sample server Petstore server. For this sample, you can use the api key + `special-key` to test the authorization filters. + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{orderId}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + Set-Cookie: + description: >- + Cookie authentication key for use with the `api_key` + apiKey authentication. + schema: + type: string + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when toekn expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - api_key: [] +externalDocs: + description: Find out more about Swagger + url: 'http://swagger.io' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + schemas: + Order: + title: Pet Order + description: An order for a pets from the pet store + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + xml: + name: Category + User: + title: a User + description: A User who is purchasing from the pet store + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + title: An uploaded response + description: Describes the result of uploading an image resource + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index be324c44a9c8..c594694ead39 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.2.1-SNAPSHOT + 5.3.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 1189eb81d531..08f2fdea6911 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.2.1-SNAPSHOT + 5.3.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index fc98a969d14e..4d0b35007fa1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -256,6 +256,9 @@ apiTemplateFiles are for API outputs only (controllers/handlers). // A cache to efficiently lookup a Schema instance based on the return value of `toModelName()`. private Map modelNameToSchemaCache; + // A cache to efficiently lookup schema `toModelName()` based on the schema Key + private Map schemaKeyToModelNameCache = new HashMap<>(); + @Override public List cliOptions() { return cliOptions; @@ -2322,7 +2325,13 @@ public String toApiName(String name) { */ @Override public String toModelName(final String name) { - return camelize(modelNamePrefix + "_" + name + "_" + modelNameSuffix); + if (schemaKeyToModelNameCache.containsKey(name)) { + return schemaKeyToModelNameCache.get(name); + } + + String camelizedName = camelize(modelNamePrefix + "_" + name + "_" + modelNameSuffix); + schemaKeyToModelNameCache.put(name, camelizedName); + return camelizedName; } private static class NamedSchema { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index fa09150e5557..7093997f0b92 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -90,6 +90,9 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co // special property keywords not allowed as these are the function names in the model files protected Set propertySpecialKeywords = new HashSet<>(Arrays.asList("ToString", "ToJson", "GetHashCode", "Equals", "ShouldSerializeToString")); + // A cache to efficiently lookup schema `toModelName()` based on the schema Key + private Map schemaKeyToModelNameCache = new HashMap<>(); + public AbstractCSharpCodegen() { super(); @@ -1035,6 +1038,13 @@ public String toModelName(String name) { if (importMapping.containsKey(name)) { return importMapping.get(name); } + + // memoization + String origName = name; + if (schemaKeyToModelNameCache.containsKey(origName)) { + return schemaKeyToModelNameCache.get(origName); + } + if (!StringUtils.isEmpty(modelNamePrefix)) { name = modelNamePrefix + "_" + name; } @@ -1058,9 +1068,12 @@ public String toModelName(String name) { name = "model_" + name; // e.g. 200Response => Model200Response (after camelize) } + String camelizedName = camelize(name); + schemaKeyToModelNameCache.put(origName, camelizedName); + // camelize the model name // phone_number => PhoneNumber - return camelize(name); + return camelizedName; } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index a5d05d09cb69..f4557791a995 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -17,7 +17,56 @@ package org.openapitools.codegen.languages; +import static org.openapitools.codegen.utils.StringUtils.camelize; +import static org.openapitools.codegen.utils.StringUtils.escape; +import static org.openapitools.codegen.utils.StringUtils.underscore; + +import java.io.File; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeSet; +import java.util.regex.Pattern; +import java.util.stream.Stream; + +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.DefaultCodegen; +import org.openapitools.codegen.meta.features.ClientModificationFeature; +import org.openapitools.codegen.meta.features.DocumentationFeature; +import org.openapitools.codegen.meta.features.GlobalFeature; +import org.openapitools.codegen.meta.features.SchemaSupportFeature; +import org.openapitools.codegen.meta.features.SecurityFeature; +import org.openapitools.codegen.meta.features.WireFormatFeature; +import org.openapitools.codegen.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.google.common.base.Strings; +import com.google.common.collect.Sets; + import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; @@ -250,8 +299,8 @@ public AbstractJavaCodegen() { cliOptions.add(CliOption.newBoolean(DISABLE_HTML_ESCAPING, "Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)", disableHtmlEscaping)); cliOptions.add(CliOption.newString(BOOLEAN_GETTER_PREFIX, "Set booleanGetterPrefix").defaultValue(this.getBooleanGetterPrefix())); cliOptions.add(CliOption.newBoolean(IGNORE_ANYOF_IN_ENUM, "Ignore anyOf keyword in enum", ignoreAnyOfInEnum)); - cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations)")); cliOptions.add(CliOption.newString(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, "Additional annotations for enum type(class level annotations)")); + cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); cliOptions.add(CliOption.newBoolean(OPENAPI_NULLABLE, "Enable OpenAPI Jackson Nullable library", this.openApiNullable)); cliOptions.add(CliOption.newString(CodegenConstants.PARENT_GROUP_ID, CodegenConstants.PARENT_GROUP_ID_DESC)); @@ -297,8 +346,7 @@ public void processOpts() { if (additionalProperties.containsKey(ADDITIONAL_MODEL_TYPE_ANNOTATIONS)) { String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_MODEL_TYPE_ANNOTATIONS).toString(); - - this.setAdditionalModelTypeAnnotations(Arrays.asList(additionalAnnotationsList.split(";"))); + this.setAdditionalModelTypeAnnotations(new ArrayList<>(Sets.newHashSet(additionalAnnotationsList.trim().split("\\s*(;|\\r?\\n)\\s*")))); } if (additionalProperties.containsKey(ADDITIONAL_ENUM_TYPE_ANNOTATIONS)) { @@ -1879,6 +1927,10 @@ public void setParentOverridden(final boolean parentOverridden) { this.parentOverridden = parentOverridden; } + public List getAdditionalModelTypeAnnotations() { + return additionalModelTypeAnnotations; + } + public void setAdditionalModelTypeAnnotations(final List additionalModelTypeAnnotations) { this.additionalModelTypeAnnotations = additionalModelTypeAnnotations; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java index 18cfb324f9a2..0aa6cb256854 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppPistacheServerCodegen.java @@ -381,42 +381,79 @@ public String getTypeDeclaration(Schema p) { @Override public String toDefaultValue(Schema p) { - if (ModelUtils.isBooleanSchema(p)) { - return "false"; + if (ModelUtils.isStringSchema(p)) { + if (p.getDefault() != null) { + return "\"" + p.getDefault().toString() + "\""; + } else { + return "\"\""; + } + } else if (ModelUtils.isBooleanSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } else { + return "false"; + } } else if (ModelUtils.isDateSchema(p)) { - return "\"\""; + if (p.getDefault() != null) { + return "\"" + p.getDefault().toString() + "\""; + } else { + return "\"\""; + } } else if (ModelUtils.isDateTimeSchema(p)) { - return "\"\""; + if (p.getDefault() != null) { + return "\"" + p.getDefault().toString() + "\""; + } else { + return "\"\""; + } } else if (ModelUtils.isNumberSchema(p)) { - if (ModelUtils.isFloatSchema(p)) { - return "0.0f"; + if (ModelUtils.isFloatSchema(p)) { // float + if (p.getDefault() != null) { + return p.getDefault().toString() + "f"; + } else { + return "0.0f"; + } + } else { // double + if (p.getDefault() != null) { + return p.getDefault().toString(); + } else { + return "0.0"; + } } - return "0.0"; } else if (ModelUtils.isIntegerSchema(p)) { - if (ModelUtils.isLongSchema(p)) { - return "0L"; + if (ModelUtils.isLongSchema(p)) { // long + if (p.getDefault() != null) { + return p.getDefault().toString() + "L"; + } else { + return "0L"; + } + } else { // integer + if (p.getDefault() != null) { + return p.getDefault().toString(); + } else { + return "0"; + } } - return "0"; } else if (ModelUtils.isByteArraySchema(p)) { - return "\"\""; + if (p.getDefault() != null) { + return "\"" + p.getDefault().toString() + "\""; + } else { + return "\"\""; + } } else if (ModelUtils.isMapSchema(p)) { String inner = getSchemaType(getAdditionalProperties(p)); return "std::map()"; } else if (ModelUtils.isArraySchema(p)) { ArraySchema ap = (ArraySchema) p; String inner = getSchemaType(ap.getItems()); - return "std::vector<" + inner + ">()"; - } else if (!StringUtils.isEmpty(p.get$ref())) { // model - return toModelName(ModelUtils.getSimpleRef(p.get$ref())) + "()"; - } else if (ModelUtils.isStringSchema(p)) { - if (p.getDefault() == null) { - return "\"\""; - } else { - return "\"" + p.getDefault().toString() + "\""; + if (!languageSpecificPrimitives.contains(inner)) { + inner = "std::shared_ptr<" + inner + ">"; } + return "std::vector<" + inner + ">()"; + } else if (!StringUtils.isEmpty(p.get$ref())) { + return "std::make_shared<" + toModelName(ModelUtils.getSimpleRef(p.get$ref())) + ">()"; } - return ""; + return "nullptr"; } /** diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index 11861b579249..60c0d9117db8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -49,6 +49,9 @@ public class GoClientCodegen extends AbstractGoCodegen { protected boolean isGoSubmodule = false; protected boolean useOneOfDiscriminatorLookup = false; // use oneOf discriminator's mapping for model lookup + // A cache to efficiently lookup schema `toModelName()` based on the schema Key + private Map schemaKeyToModelNameCache = new HashMap<>(); + public GoClientCodegen() { super(); @@ -312,8 +315,14 @@ public String toApiDocFilename(String name) { @Override public String toModelName(String name) { + if (schemaKeyToModelNameCache.containsKey(name)) { + return schemaKeyToModelNameCache.get(name); + } + // underscoring would also lowercase the whole name, thus losing acronyms which are in capitals - return camelize(toModel(name, false)); + String camelizedName = camelize(toModel(name, false)); + schemaKeyToModelNameCache.put(name, camelizedName); + return camelizedName; } public String escapeReservedWord(String name) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java new file mode 100644 index 000000000000..df5073d8d928 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaMicronautClientCodegen.java @@ -0,0 +1,339 @@ +package org.openapitools.codegen.languages; + +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.languages.features.BeanValidationFeatures; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.meta.features.DocumentationFeature; +import org.openapitools.codegen.meta.features.SecurityFeature; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.HashMap; + +import static org.openapitools.codegen.CodegenConstants.INVOKER_PACKAGE; + + +public class JavaMicronautClientCodegen extends AbstractJavaCodegen implements BeanValidationFeatures { + + private final Logger LOGGER = LoggerFactory.getLogger(JavaClientCodegen.class); + + public static final String OPT_TITLE = "title"; + public static final String OPT_CONFIG_PACKAGE = "configPackage"; + public static final String OPT_CONFIGURE_AUTH = "configureAuth"; + public static final String OPT_BUILD = "build"; + public static final String OPT_BUILD_GRADLE = "gradle"; + public static final String OPT_BUILD_MAVEN = "maven"; + public static final String OPT_BUILD_ALL = "all"; + public static final String OPT_TEST = "test"; + public static final String OPT_TEST_JUNIT = "junit"; + public static final String OPT_TEST_SPOCK = "spock"; + + public static final String NAME = "java-micronaut-client"; + + protected String title; + protected String configPackage; + protected boolean useBeanValidation; + protected boolean configureAuthorization; + protected String buildTool; + protected String testTool; + + public JavaMicronautClientCodegen() { + super(); + + title = "OpenAPI Micronaut Client"; + invokerPackage = "org.openapitools"; + configPackage = "org.openapitools.configuration"; + useBeanValidation = true; + configureAuthorization = false; + buildTool = OPT_BUILD_ALL; + testTool = OPT_TEST_JUNIT; + + modifyFeatureSet(features -> features + .includeDocumentationFeatures( + DocumentationFeature.Readme + ) + .securityFeatures(EnumSet.of( + SecurityFeature.ApiKey, + SecurityFeature.BasicAuth, + SecurityFeature.OAuth2_Implicit, + SecurityFeature.OAuth2_AuthorizationCode, + SecurityFeature.OAuth2_ClientCredentials, + SecurityFeature.OAuth2_Password, + SecurityFeature.OpenIDConnect + )) + ); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + + outputFolder = "generated-code/java-micronaut-client"; + embeddedTemplateDir = templateDir = "java-micronaut-client"; + apiPackage = "org.openapitools.api"; + modelPackage = "org.openapitools.model"; + invokerPackage = "org.openapitools"; + artifactId = "openapi-micronaut"; + + updateOption(INVOKER_PACKAGE, this.getInvokerPackage()); + updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId()); + updateOption(CodegenConstants.API_PACKAGE, apiPackage); + updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); + + apiTestTemplateFiles.clear(); + + additionalProperties.put("jackson", "true"); + additionalProperties.put("openbrace", "{"); + additionalProperties.put("closebrace", "}"); + + cliOptions.add(new CliOption(OPT_TITLE, "Client service name").defaultValue(title)); + cliOptions.add(new CliOption(OPT_CONFIG_PACKAGE, "Configuration package for generated code").defaultValue(configPackage)); + cliOptions.add(CliOption.newBoolean(OPT_CONFIGURE_AUTH, "Configure all the authorization methods as specified in the file", configureAuthorization)); + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations", useBeanValidation)); + + CliOption buildToolOption = new CliOption(OPT_BUILD, "Specify for which build tool to generate files").defaultValue(buildTool); + buildToolOption.setEnum(new HashMap() {{ + put(OPT_BUILD_GRADLE, "Gradle configuration is generated for the project"); + put(OPT_BUILD_MAVEN, "Maven configuration is generated for the project"); + put(OPT_BUILD_ALL, "Both Gradle and Maven configurations are generated"); + }}); + cliOptions.add(buildToolOption); + + CliOption testToolOption = new CliOption(OPT_TEST, "Specify which test tool to generate files for").defaultValue(testTool); + testToolOption.setEnum(new HashMap() {{ + put(OPT_TEST_JUNIT, "Use JUnit as test tool"); + put(OPT_TEST_SPOCK, "Use Spock as test tool"); + }}); + cliOptions.add(testToolOption); + + // Remove the date library option + cliOptions.stream().filter(o -> o.getOpt().equals("dateLibrary")).findFirst() + .ifPresent(v -> cliOptions.remove(v)); + + // Add reserved words + String[] reservedWordsArray = new String[]{ + "client", "format", "queryvalue", "queryparam", "pathvariable", "header", "cookie", + "authorization", "body", "application" + }; + reservedWords.addAll(Arrays.asList(reservedWordsArray)); + } + + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + @Override + public String getName() { + return NAME; + } + + @Override + public String getHelp() { + return "Generates a Java Micronaut Client."; + } + + @Override + public void processOpts() { + super.processOpts(); + + // Get properties + if (additionalProperties.containsKey(OPT_TITLE)) { + this.title = (String) additionalProperties.get(OPT_TITLE); + } + + if (additionalProperties.containsKey(OPT_CONFIG_PACKAGE)) { + configPackage = (String) additionalProperties.get(OPT_CONFIG_PACKAGE); + } else { + additionalProperties.put(OPT_CONFIG_PACKAGE, configPackage); + } + + if (additionalProperties.containsKey(INVOKER_PACKAGE)) { + invokerPackage = (String) additionalProperties.get(INVOKER_PACKAGE); + } else { + additionalProperties.put(INVOKER_PACKAGE, invokerPackage); + } + + // Get boolean properties + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + + if (additionalProperties.containsKey(OPT_CONFIGURE_AUTH)) { + this.configureAuthorization = convertPropertyToBoolean(OPT_CONFIGURE_AUTH); + } + writePropertyBack(OPT_CONFIGURE_AUTH, configureAuthorization); + + // Get enum properties + if (additionalProperties.containsKey(OPT_BUILD)) { + switch ((String) additionalProperties.get(OPT_BUILD)) { + case OPT_BUILD_GRADLE: + case OPT_BUILD_MAVEN: + case OPT_BUILD_ALL: + this.buildTool = (String) additionalProperties.get(OPT_BUILD); + break; + default: + throw new RuntimeException("Build tool \"" + additionalProperties.get(OPT_BUILD) + "\" is not supported or misspelled."); + } + } + additionalProperties.put(OPT_BUILD, buildTool); + + if (additionalProperties.containsKey(OPT_TEST)) { + switch ((String) additionalProperties.get(OPT_TEST)) { + case OPT_TEST_JUNIT: + case OPT_TEST_SPOCK: + this.testTool = (String) additionalProperties.get(OPT_TEST); + break; + default: + throw new RuntimeException("Test tool \"" + additionalProperties.get(OPT_TEST) + "\" is not supported or misspelled."); + } + } + additionalProperties.put(OPT_TEST, testTool); + if (testTool.equals(OPT_TEST_JUNIT)) { + additionalProperties.put("isTestJunit", true); + } else if (testTool.equals(OPT_TEST_SPOCK)) { + additionalProperties.put("isTestSpock", true); + } + + final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); + final String apiFolder = (sourceFolder + '/' + apiPackage).replace(".", "/"); + + // Add all the supporting files + String resourceFolder = projectFolder + "/resources"; + supportingFiles.add(new SupportingFile("configuration/application.yml.mustache", resourceFolder, "application.yml").doNotOverwrite()); + + // Authorization files + if (configureAuthorization) { + final String authFolder = invokerFolder + "/auth"; + supportingFiles.add(new SupportingFile("auth/Authorization.mustache", authFolder, "Authorization.java")); + supportingFiles.add(new SupportingFile("auth/AuthorizationBinder.mustache", authFolder, "AuthorizationBinder.java")); + supportingFiles.add(new SupportingFile("auth/Authorizations.mustache", authFolder, "Authorizations.java")); + supportingFiles.add(new SupportingFile("auth/AuthorizationFilter.mustache", authFolder, "AuthorizationFilter.java")); + final String authConfigurationFolder = authFolder + "/configuration"; + supportingFiles.add(new SupportingFile("auth/configuration/ApiKeyAuthConfiguration.mustache", authConfigurationFolder, "ApiKeyAuthConfiguration.java")); + supportingFiles.add(new SupportingFile("auth/configuration/ConfigurableAuthorization.mustache", authConfigurationFolder, "ConfigurableAuthorization.java")); + supportingFiles.add(new SupportingFile("auth/configuration/HttpBasicAuthConfiguration.mustache", authConfigurationFolder, "HttpBasicAuthConfiguration.java")); + } + + // Query files + final String queryFolder = invokerFolder + "/query"; + supportingFiles.add(new SupportingFile("query/QueryParam.mustache", queryFolder, "QueryParam.java")); + supportingFiles.add(new SupportingFile("query/QueryParamBinder.mustache", queryFolder, "QueryParamBinder.java")); + + if (buildTool.equals(OPT_BUILD_GRADLE) || buildTool.equals(OPT_BUILD_ALL)) { + // Gradle files + supportingFiles.add(new SupportingFile("configuration/gradle/build.gradle.mustache", "", "build.gradle").doNotOverwrite()); + supportingFiles.add(new SupportingFile("configuration/gradle/settings.gradle.mustache", "", "settings.gradle").doNotOverwrite()); + supportingFiles.add(new SupportingFile("configuration/gradle/gradle.properties.mustache", "", "gradle.properties").doNotOverwrite()); + + // Gradlew files + final String gradleWrapperFolder = "gradle/wrapper"; + supportingFiles.add(new SupportingFile("configuration/gradlew/gradlew.mustache", "", "gradlew")); + supportingFiles.add(new SupportingFile("configuration/gradlew/gradlew.bat.mustache", "", "gradlew.bat")); + supportingFiles.add(new SupportingFile("configuration/gradlew/gradle-wrapper.properties.mustache", gradleWrapperFolder, "gradle-wrapper.properties")); + supportingFiles.add(new SupportingFile("configuration/gradlew/gradle-wrapper.jar", gradleWrapperFolder, "gradle-wrapper.jar")); + } + + if (buildTool.equals(OPT_BUILD_MAVEN) || buildTool.equals(OPT_BUILD_ALL)) { + // Maven files + supportingFiles.add(new SupportingFile("configuration/pom.xml.mustache", "", "pom.xml").doNotOverwrite()); + + // Maven wrapper files + supportingFiles.add(new SupportingFile("configuration/mavenw/mvnw.mustache", "", "mvnw")); + supportingFiles.add(new SupportingFile("configuration/mavenw/mvnw.bat.mustache", "", "mvnw.bat")); + supportingFiles.add(new SupportingFile("configuration/mavenw/MavenWrapperDownloader.java.mustache", ".mvn/wrapper", "MavenWrapperDownloader.java")); + supportingFiles.add(new SupportingFile("configuration/mavenw/maven-wrapper.jar.mustache", ".mvn/wrapper", "maven-wrapper.jar")); + supportingFiles.add(new SupportingFile("configuration/mavenw/maven-wrapper.properties.mustache", ".mvn/wrapper", "maren-wrapper.properties")); + } + + // Git files + supportingFiles.add(new SupportingFile("configuration/git/gitignore.mustache", "", ".gitignore").doNotOverwrite()); + + // Use the default java Date + typeMapping.put("date", "LocalDate"); + typeMapping.put("DateTime", "LocalDateTime"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("LocalDateTime", "java.time.LocalDateTime"); + + // Add documentation files + supportingFiles.add(new SupportingFile("doc/README.mustache", "", "README.md").doNotOverwrite()); + supportingFiles.add(new SupportingFile("doc/auth.mustache", apiDocPath, "auth.md")); + modelDocTemplateFiles.put("doc/model_doc.mustache", ".md"); + apiDocTemplateFiles.put("doc/api_doc.mustache", ".md"); + modelDocTemplateFiles.remove("model_doc.mustache"); + apiDocTemplateFiles.remove("api_doc.mustache"); + + // Add model files + modelTemplateFiles.remove("model.mustache"); + modelTemplateFiles.put("model/model.mustache", ".java"); + + // Add test files + if (testTool.equals(OPT_TEST_JUNIT)) { + apiTestTemplateFiles.put("api_test.mustache", ".java"); + modelTestTemplateFiles.put("model_test.mustache", ".java"); + } else if (testTool.equals(OPT_TEST_SPOCK)) { + apiTestTemplateFiles.put("api_test.groovy.mustache", ".groovy"); + modelTestTemplateFiles.put("model_test.groovy.mustache", ".groovy"); + } + } + + @Override + public String apiTestFileFolder() { + if (testTool.equals(OPT_TEST_SPOCK)) { + return getOutputDir() + "/src/test/groovy/" + getInvokerPackage().replaceAll("\\.", "/") + "/api"; + } + return getOutputDir() + "/src/test/java/" + getInvokerPackage().replaceAll("\\.", "/") + "/api"; + } + + @Override + public String modelTestFileFolder() { + if (testTool.equals(OPT_TEST_SPOCK)) { + return getOutputDir() + "/src/test/groovy/" + getInvokerPackage().replaceAll("\\.", "/") + "/model"; + } + return getOutputDir() + "/src/test/java/" + getInvokerPackage().replaceAll("\\.", "/") + "/model"; + } + + @Override + public String toApiTestFilename(String name) { + if (testTool.equals(OPT_TEST_SPOCK)) { + return toApiName(name) + "Spec"; + } + return toApiName(name) + "Test"; + } + + @Override + public String toModelTestFilename(String name) { + if (testTool.equals(OPT_TEST_SPOCK)) { + return toModelName(name) + "Spec"; + } + return toModelName(name) + "Test"; + } + + @Override + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } + + @Override + public String toApiVarName(String name) { + String apiVarName = super.toApiVarName(name); + if (reservedWords.contains(apiVarName)) { + apiVarName = escapeReservedWord(apiVarName); + } + return apiVarName; + } + + public boolean isUseBeanValidation() { + return useBeanValidation; + } + + public boolean isConfigureAuthorization() { + return configureAuthorization; + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpDataTransferClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpDataTransferClientCodegen.java new file mode 100644 index 000000000000..38fc3332ee18 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpDataTransferClientCodegen.java @@ -0,0 +1,453 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * 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 + * + * https://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.codegen.languages; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.PathItem.HttpMethod; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.responses.ApiResponses; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.*; + +public class PhpDataTransferClientCodegen extends AbstractPhpCodegen { + private final Logger LOGGER = LoggerFactory.getLogger(PhpDataTransferClientCodegen.class); + // Custom generator option names + public static final String OPT_MODERN = "modern"; + // Internal vendor extension names for extra template data that should not be set in specification + public static final String VEN_PARAMETER_LOCATION = "internal.parameterLocation"; + public static final String VEN_FROM_PARAMETERS = "internal.fromParameters"; + public static final String VEN_COLLECTION_FORMAT = "internal.collectionFormat"; + public static final String VEN_PARAMETER_DATA_TYPE = "internal.parameterDataType"; + public static final String VEN_HAS_PARAMETER_DATA = "internal.hasParameterData"; + public static final String VEN_FROM_CONTAINER = "internal.fromContainer"; + public static final String VEN_CONTAINER_DATA_TYPE = "internal.containerDataType"; + + private boolean useModernSyntax = false; + + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + @Override + public String getName() { + return "php-dt"; + } + + @Override + public String getHelp() { + return "Generates a PHP client relying on Data Transfer ( https://github.com/Articus/DataTransfer ) and compliant with PSR-7, PSR-11, PSR-17 and PSR-18."; + } + + public PhpDataTransferClientCodegen() { + super(); + modifyFeatureSet(features -> features + .includeDocumentationFeatures(DocumentationFeature.Readme) + .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON)) + .securityFeatures(EnumSet.noneOf(SecurityFeature.class)) + .excludeGlobalFeatures( + GlobalFeature.XMLStructureDefinitions, + GlobalFeature.Callbacks, + GlobalFeature.LinkObjects, + GlobalFeature.ParameterStyling + ) + .excludeSchemaSupportFeatures( + SchemaSupportFeature.Polymorphism + ) + ); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + + //no point to use double - http://php.net/manual/en/language.types.float.php , especially because of PHP 7+ float type declaration + typeMapping.put("double", "float"); + + apiTemplateFiles.clear(); + apiTestTemplateFiles.clear(); + apiDocTemplateFiles.clear(); + modelTestTemplateFiles.clear(); + modelDocTemplateFiles.clear(); + + additionalProperties.put(CodegenConstants.ARTIFACT_VERSION, "1.0.0"); + //Register custom CLI options + addSwitch(OPT_MODERN, "use modern language features (generated code will require PHP 8.0)", useModernSyntax); + } + + @Override + public void processOpts() { + setSrcBasePath("src"); + //Preserve and process options mangled in parent class + String rootNamespace = "App"; + if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { + rootNamespace = (String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE); + } + String modelNamespace = rootNamespace + "\\DTO"; + if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { + modelNamespace = (String) additionalProperties.get(CodegenConstants.MODEL_PACKAGE); + } + super.processOpts(); + //Restore mangled options + setInvokerPackage(rootNamespace); + additionalProperties.put(CodegenConstants.INVOKER_PACKAGE, rootNamespace); + setModelPackage(modelNamespace); + additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelNamespace); + //Process custom options + if (additionalProperties.containsKey(OPT_MODERN)) { + embeddedTemplateDir = templateDir = "php-dt-modern"; + useModernSyntax = true; + } else { + embeddedTemplateDir = templateDir = "php-dt"; + } + + supportingFiles.add(new SupportingFile("composer.json.mustache", "", "composer.json")); + supportingFiles.add(new SupportingFile("ApiClient.php.mustache", toSrcPath(invokerPackage, srcBasePath), "ApiClient.php")); + supportingFiles.add(new SupportingFile("ApiClientFactory.php.mustache", toSrcPath(invokerPackage, srcBasePath), "ApiClientFactory.php")); + supportingFiles.add(new SupportingFile("README.md.mustache", "", "README.md")); + } + + @Override + public String toSrcPath(String packageName, String basePath) { + return basePath + File.separator + packageName.replace("\\", File.separator); + } + + @Override + public String toApiName(String name) { + return super.toApiName(toModelName(name)); + } + + @Override + public String getTypeDeclaration(Schema p) { + String result; + Map extensions = p.getExtensions(); + if ((extensions != null) && extensions.containsKey(VEN_CONTAINER_DATA_TYPE)) { + result = (String) extensions.get(VEN_CONTAINER_DATA_TYPE); + } else if (useModernSyntax && (ModelUtils.isArraySchema(p) || ModelUtils.isMapSchema(p))) { + result = "array"; + } else { + result = super.getTypeDeclaration(p); + } + return result; + } + + @Override + public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { + //Do not use tags for operation grouping + super.addOperationToGroup("", resourcePath, operation, co, operations); + } + + @Override + protected String getContentType(RequestBody requestBody) { + //Awfully nasty workaround to skip formParams generation + return null; + } + + @Override + public void preprocessOpenAPI(OpenAPI openAPI) { + super.preprocessOpenAPI(openAPI); + + generateParameterSchemas(openAPI); + generateContainerSchemas(openAPI); + } + + @Override + public void processOpenAPI(OpenAPI openAPI) { + super.processOpenAPI(openAPI); + + quoteMediaTypes(openAPI); + } + + /** + * Generate additional model definitions from query parameters + * + * @param openAPI OpenAPI object + */ + protected void generateParameterSchemas(OpenAPI openAPI) { + Map paths = openAPI.getPaths(); + if (paths != null) { + for (String pathname : paths.keySet()) { + PathItem path = paths.get(pathname); + Map operationMap = path.readOperationsMap(); + if (operationMap != null) { + for (HttpMethod method : operationMap.keySet()) { + Operation operation = operationMap.get(method); + Map propertySchemas = new HashMap<>(); + if (operation == null || operation.getParameters() == null) { + continue; + } + + List requiredProperties = new ArrayList<>(); + for (Parameter parameter : operation.getParameters()) { + Parameter referencedParameter = ModelUtils.getReferencedParameter(openAPI, parameter); + Schema propertySchema = convertParameterToSchema(openAPI, referencedParameter); + if (propertySchema != null) { + propertySchemas.put(propertySchema.getName(), propertySchema); + if (Boolean.TRUE.equals(referencedParameter.getRequired())) { + requiredProperties.add(propertySchema.getName()); + } + } + } + + if (!propertySchemas.isEmpty()) { + ObjectSchema schema = new ObjectSchema(); + String operationId = getOrGenerateOperationId(operation, pathname, method.name()); + schema.setDescription("Parameters for " + operationId); + schema.setProperties(propertySchemas); + schema.setRequired(requiredProperties); + addInternalExtensionToSchema(schema, VEN_FROM_PARAMETERS, Boolean.TRUE); + String schemaName = generateUniqueSchemaName(openAPI, operationId + "ParameterData"); + openAPI.getComponents().addSchemas(schemaName, schema); + String schemaDataType = getTypeDeclaration(toModelName(schemaName)); + addInternalExtensionToOperation(operation, VEN_PARAMETER_DATA_TYPE, schemaDataType); + addInternalExtensionToOperation(operation, VEN_HAS_PARAMETER_DATA, Boolean.TRUE); + } + } + } + } + } + } + + protected Schema convertParameterToSchema(OpenAPI openAPI, Parameter parameter) { + Schema property = null; + + Schema parameterSchema = ModelUtils.getReferencedSchema(openAPI, parameter.getSchema()); + // array + if (ModelUtils.isArraySchema(parameterSchema)) { + Schema itemSchema = ((ArraySchema) parameterSchema).getItems(); + ArraySchema arraySchema = new ArraySchema(); + arraySchema.setMinItems(parameterSchema.getMinItems()); + arraySchema.setMaxItems(parameterSchema.getMaxItems()); + arraySchema.setItems(itemSchema); + String collectionFormat = getCollectionFormat(parameter); + if (collectionFormat == null) { + collectionFormat = "csv"; + } + addInternalExtensionToSchema(arraySchema, VEN_COLLECTION_FORMAT, collectionFormat); + property = arraySchema; + } else { // non-array e.g. string, integer + switch (parameterSchema.getType()) { + case "string": + StringSchema stringSchema = new StringSchema(); + stringSchema.setMinLength(parameterSchema.getMinLength()); + stringSchema.setMaxLength(parameterSchema.getMaxLength()); + stringSchema.setPattern(parameterSchema.getPattern()); + stringSchema.setEnum(parameterSchema.getEnum()); + property = stringSchema; + break; + case "integer": + IntegerSchema integerSchema = new IntegerSchema(); + integerSchema.setMinimum(parameterSchema.getMinimum()); + integerSchema.setMaximum(parameterSchema.getMaximum()); + property = integerSchema; + break; + case "number": + NumberSchema floatSchema = new NumberSchema(); + floatSchema.setMinimum(parameterSchema.getMinimum()); + floatSchema.setMaximum(parameterSchema.getMaximum()); + property = floatSchema; + break; + case "boolean": + property = new BooleanSchema(); + break; + case "date": + property = new DateSchema(); + break; + case "date-time": + property = new DateTimeSchema(); + break; + } + } + + if (property != null) { + property.setName(parameter.getName()); + property.setDescription(parameter.getDescription()); + addInternalExtensionToSchema(property, VEN_PARAMETER_LOCATION, parameter.getIn()); + } + return property; + } + + protected void addInternalExtensionToSchema(Schema schema, String name, Object value) { + //Add internal extension directly, because addExtension filters extension names + if (schema.getExtensions() == null) { + schema.setExtensions(new HashMap<>()); + } + schema.getExtensions().put(name, value); + } + + protected void addInternalExtensionToOperation(Operation operation, String name, Object value) { + //Add internal extension directly, because addExtension filters extension names + if (operation.getExtensions() == null) { + operation.setExtensions(new HashMap<>()); + } + operation.getExtensions().put(name, value); + } + + protected String generateUniqueSchemaName(OpenAPI openAPI, String name) { + String result = name; + if (openAPI.getComponents().getSchemas() != null) { + int count = 1; + while (openAPI.getComponents().getSchemas().containsKey(result)) { + result = name + "_" + count; + count += 1; + } + } + return result; + } + + /** + * Generate additional model definitions for containers in whole specification + * + * @param openAPI OpenAPI object + */ + protected void generateContainerSchemas(OpenAPI openAPI) { + Paths paths = openAPI.getPaths(); + for (String pathName : paths.keySet()) { + for (Operation operation : paths.get(pathName).readOperations()) { + List parameters = operation.getParameters(); + if (parameters != null) { + for (Parameter parameter : parameters) { + generateContainerSchemas(openAPI, ModelUtils.getReferencedParameter(openAPI, parameter).getSchema()); + } + } + RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, operation.getRequestBody()); + if (requestBody != null) { + Content requestBodyContent = requestBody.getContent(); + if (requestBodyContent != null) { + for (String mediaTypeName : requestBodyContent.keySet()) { + generateContainerSchemas(openAPI, requestBodyContent.get(mediaTypeName).getSchema()); + } + } + } + ApiResponses responses = operation.getResponses(); + for (String responseCode : responses.keySet()) { + ApiResponse response = ModelUtils.getReferencedApiResponse(openAPI, responses.get(responseCode)); + Content responseContent = response.getContent(); + if (responseContent != null) { + for (String mediaTypeName : responseContent.keySet()) { + generateContainerSchemas(openAPI, responseContent.get(mediaTypeName).getSchema()); + } + } + } + } + } + } + + /** + * Generate additional model definitions for containers in specified schema + * + * @param openAPI OpenAPI object + * @param schema OAS schema to process + */ + protected void generateContainerSchemas(OpenAPI openAPI, Schema schema) { + if (schema != null) { + //Dereference schema + schema = ModelUtils.getReferencedSchema(openAPI, schema); + Boolean isContainer = Boolean.FALSE; + + if (ModelUtils.isObjectSchema(schema)) { + //Recursively process all schemas of object properties + Map properties = schema.getProperties(); + if (properties != null) { + for (String propertyName : properties.keySet()) { + generateContainerSchemas(openAPI, properties.get(propertyName)); + } + } + } else if (ModelUtils.isArraySchema(schema)) { + //Recursively process schema of array items + generateContainerSchemas(openAPI, ((ArraySchema) schema).getItems()); + isContainer = Boolean.TRUE; + } else if (ModelUtils.isMapSchema(schema)) { + //Recursively process schema of map items + Object itemSchema = schema.getAdditionalProperties(); + if (itemSchema instanceof Schema) { + generateContainerSchemas(openAPI, (Schema) itemSchema); + } + isContainer = Boolean.TRUE; + } + + if (isContainer) { + //Generate special component schema for container + String containerSchemaName = generateUniqueSchemaName(openAPI, "Collection"); + Schema containerSchema = new ObjectSchema(); + containerSchema.addProperties("inner", schema); + addInternalExtensionToSchema(containerSchema, VEN_FROM_CONTAINER, Boolean.TRUE); + openAPI.getComponents().addSchemas(containerSchemaName, containerSchema); + String containerDataType = getTypeDeclaration(toModelName(containerSchemaName)); + addInternalExtensionToSchema(schema, VEN_CONTAINER_DATA_TYPE, containerDataType); + } + } + } + + /** + * Awfully nasty workaround - add quotation marks for all media types to prevent special treatment of form media types + * in org/openapitools/codegen/DefaultGenerator.java:873 + * TODO find a better way to prevent special form media type treatment + * + * @param openAPI OpenAPI object + */ + protected void quoteMediaTypes(OpenAPI openAPI) { + Map paths = openAPI.getPaths(); + if (paths != null) { + for (String pathname : paths.keySet()) { + PathItem path = paths.get(pathname); + List operations = path.readOperations(); + if (operations != null) { + for (Operation operation : operations) { + RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, operation.getRequestBody()); + if (requestBody != null) { + requestBody.setContent(copyWithQuotedMediaTypes(requestBody.getContent())); + } + ApiResponses responses = operation.getResponses(); + for (String responseCode : responses.keySet()) { + ApiResponse response = ModelUtils.getReferencedApiResponse(openAPI, responses.get(responseCode)); + response.setContent(copyWithQuotedMediaTypes(response.getContent())); + } + } + } + } + } + } + + protected Content copyWithQuotedMediaTypes(Content content) { + Content result = null; + if (content != null) { + result = new Content(); + for (String mediaType : content.keySet()) { + result.addMediaType("'" + mediaType + "'", content.get(mediaType)); + } + } + return result; + } +} diff --git a/modules/openapi-generator/src/main/resources/Ada/README.mustache b/modules/openapi-generator/src/main/resources/Ada/README.mustache index d3ca2efef390..d0f6d54028fa 100644 --- a/modules/openapi-generator/src/main/resources/Ada/README.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/README.mustache @@ -74,7 +74,7 @@ All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}[**{{nickname}}**]({{apiDocPath}}{{classname}}.md#{{nickname}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}[**{{nickname}}**]({{apiDocPath}}{{classname}}.md#{{nickname}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ### Models diff --git a/modules/openapi-generator/src/main/resources/Ada/client-body.mustache b/modules/openapi-generator/src/main/resources/Ada/client-body.mustache index 71b3e314a957..b13f1af12910 100644 --- a/modules/openapi-generator/src/main/resources/Ada/client-body.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/client-body.mustache @@ -13,7 +13,7 @@ package body {{package}}.Clients is procedure {{operationId}} (Client : in out Client_Type{{#hasParams}};{{/hasParams}}{{#allParams}} {{paramName}} : in {{^isFile}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}{{package}}.Models.{{/isContainer}}{{/isPrimitiveType}}{{/isString}}{{/isFile}}{{dataType}}{{^-last}};{{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}) is + Result : out {{.}}{{/returnType}}) is URI : Swagger.Clients.URI_Type;{{#hasBodyParam}} Req : Swagger.Clients.Request_Type;{{/hasBodyParam}}{{#hasFormParams}} Req : Swagger.Clients.Request_Type;{{/hasFormParams}} diff --git a/modules/openapi-generator/src/main/resources/Ada/client-spec.mustache b/modules/openapi-generator/src/main/resources/Ada/client-spec.mustache index 46559f0dcad3..134218b105e3 100644 --- a/modules/openapi-generator/src/main/resources/Ada/client-spec.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/client-spec.mustache @@ -17,7 +17,7 @@ package {{package}}.Clients is procedure {{operationId}} (Client : in out Client_Type{{#hasParams}};{{/hasParams}}{{#allParams}} {{paramName}} : in {{^isFile}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}{{package}}.Models.{{/isContainer}}{{/isPrimitiveType}}{{/isString}}{{/isFile}}{{dataType}}{{^-last}};{{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}); + Result : out {{.}}{{/returnType}}); {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Ada/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Ada/licenseInfo.mustache index df913f4d7128..d98c036f523f 100644 --- a/modules/openapi-generator/src/main/resources/Ada/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/licenseInfo.mustache @@ -1,8 +1,8 @@ -- {{{appName}}} -- {{{appDescription}}} -- --- {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} ---{{#infoEmail}} Contact: {{{infoEmail}}}{{/infoEmail}} +-- {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} +--{{#infoEmail}} Contact: {{{.}}}{{/infoEmail}} -- -- NOTE: This package is auto generated by OpenAPI-Generator {{{generatorVersion}}}. -- https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/Ada/server-body.mustache b/modules/openapi-generator/src/main/resources/Ada/server-body.mustache index 9768d87d6cd9..65225bef1408 100644 --- a/modules/openapi-generator/src/main/resources/Ada/server-body.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/server-body.mustache @@ -23,7 +23,7 @@ package body {{package}}.Servers is (Server : in out Server_Type{{#hasParams}};{{/hasParams}} {{#allParams}}{{paramName}} : in {{dataType}}{{^-last}}; {{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}; + Result : out {{.}}{{/returnType}}; Context : in out Swagger.Servers.Context_Type) is begin null; diff --git a/modules/openapi-generator/src/main/resources/Ada/server-properties.mustache b/modules/openapi-generator/src/main/resources/Ada/server-properties.mustache index 028837de4fce..896f026ec69c 100644 --- a/modules/openapi-generator/src/main/resources/Ada/server-properties.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/server-properties.mustache @@ -33,5 +33,3 @@ log4j.logger.Util=DEBUG log4j.logger.Servlet=DEBUG log4j.logger.Util.Serialize.Mappers=WARN log4j.logger.Util.Serialize.IO=INFO - - diff --git a/modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache b/modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache index b24ba9815dab..570508ab7fb8 100644 --- a/modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache @@ -34,7 +34,7 @@ package body {{package}}.Skeletons is {{paramName}} : {{dataType}}; {{/allParams}} {{#returnType}} - Result : {{returnType}}; + Result : {{.}}; {{/returnType}} begin {{#vendorExtensions.x-auth-scopes}} @@ -130,7 +130,7 @@ package body {{package}}.Skeletons is {{paramName}} : {{dataType}}; {{/allParams}} {{#returnType}} - Result : {{returnType}}; + Result : {{.}}; {{/returnType}} begin {{#vendorExtensions.x-auth-scopes}} @@ -219,7 +219,7 @@ package body {{package}}.Skeletons is procedure {{operationId}} ({{#allParams}}{{paramName}} : in {{dataType}}{{^-last}}; {{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}; + Result : out {{.}}{{/returnType}}; Context : in out Swagger.Servers.Context_Type) is begin Impl.{{operationId}} diff --git a/modules/openapi-generator/src/main/resources/Ada/server-skeleton-spec.mustache b/modules/openapi-generator/src/main/resources/Ada/server-skeleton-spec.mustache index d266f3b3dd2a..4365261e543a 100644 --- a/modules/openapi-generator/src/main/resources/Ada/server-skeleton-spec.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/server-skeleton-spec.mustache @@ -27,7 +27,7 @@ package {{package}}.Skeletons is (Server : in out Server_Type{{#hasParams}};{{/hasParams}} {{#allParams}}{{paramName}} : in {{dataType}}{{^-last}}; {{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}; + Result : out {{.}}{{/returnType}}; Context : in out Swagger.Servers.Context_Type) is abstract; {{/operation}} {{/operations}} @@ -95,7 +95,7 @@ package {{package}}.Skeletons is procedure {{operationId}} ({{#allParams}}{{paramName}} : in {{dataType}}{{^-last}}; {{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}; + Result : out {{.}}{{/returnType}}; Context : in out Swagger.Servers.Context_Type); {{/hasParams}} {{^hasParams}} diff --git a/modules/openapi-generator/src/main/resources/Ada/server-spec.mustache b/modules/openapi-generator/src/main/resources/Ada/server-spec.mustache index 7b08b6cd0465..4abfb7d4e4fc 100644 --- a/modules/openapi-generator/src/main/resources/Ada/server-spec.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/server-spec.mustache @@ -31,7 +31,7 @@ package {{package}}.Servers is (Server : in out Server_Type{{#hasParams}};{{/hasParams}} {{#allParams}}{{paramName}} : in {{dataType}}{{^-last}}; {{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}; + Result : out {{.}}{{/returnType}}; Context : in out Swagger.Servers.Context_Type); {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache index 41e5faf3e662..82c6b09ab4e2 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache @@ -17,7 +17,7 @@ if (OPENSSL_FOUND) include_directories(${OPENSSL_INCLUDE_DIRS}) link_directories(${OPENSSL_LIBRARIES}) message(STATUS "Using OpenSSL ${OPENSSL_VERSION}") -else() +else() message (STATUS "OpenSSL Not found.") endif() diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/README.md.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/README.md.mustache index 5d5eb19c9695..740f9b4c20d1 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/README.md.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/README.md.mustache @@ -70,7 +70,7 @@ All URIs are relative to *{{basePath}}* Category | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{classname}}_{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{classname}}_{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{classname}}_{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{classname}}_{{operationId}}) | **{{httpMethod}}** {{path}} | {{{summary}}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache index 0449acda7674..49c73f86b91d 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache @@ -91,11 +91,11 @@ end: {{#operations}} {{#operation}} {{#summary}} -// {{{summary}}} +// {{{.}}} // {{/summary}} {{#notes}} -// {{{notes}}} +// {{{.}}} // {{/notes}} {{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isArray}}{{{.}}}_t*{{/isArray}}{{#isMap}}{{{.}}}{{/isMap}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache index 961e33a9d95e..ecc80212afcf 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache @@ -25,11 +25,11 @@ typedef enum { {{projectName}}_{{operationId}}_{{enumName}}_NULL = 0{{#enumVars {{#operations}} {{#operation}} {{#summary}} -// {{{summary}}} +// {{{.}}} // {{/summary}} {{#notes}} -// {{{notes}}} +// {{{.}}} // {{/notes}} {{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isArray}}{{{.}}}_t*{{/isArray}}{{#isMap}}{{{.}}}{{/isMap}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api_doc.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api_doc.mustache index f249302c23dc..54dfa08df3cf 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api_doc.mustache @@ -1,11 +1,11 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{classname}}_{{operationId}}**]({{classname}}.md#{{classname}}_{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{classname}}_{{operationId}}**]({{classname}}.md#{{classname}}_{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -13,11 +13,11 @@ Method | HTTP request | Description # **{{classname}}_{{{operationId}}}** ```c {{#summary}} -// {{{summary}}} +// {{{.}}} // {{/summary}} {{#notes}} -// {{{notes}}} +// {{{.}}} // {{/notes}} {{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isArray}}{{{.}}}_t*{{/isArray}}{{#isMap}}{{{.}}}{{/isMap}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} {{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}}, {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{#isFreeFormObject}}{{dataType}}_t *{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isArray}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}}{{/isArray}}{{#isContainer}}{{#isArray}}{{dataType}}_t *{{/isArray}}{{#isMap}}{{dataType}}{{/isMap}}{{/isContainer}} {{{paramName}}}{{/allParams}}); @@ -26,9 +26,9 @@ Method | HTTP request | Description ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | +**apiClient** | **apiClient_t \*** | context containing the client configuration | {{#allParams}} -**{{paramName}}** | {{#isPrimitiveType}}{{#isNumber}}**{{{dataType}}}**{{/isNumber}}{{#isLong}}**{{{dataType}}}**{{/isLong}}{{#isInteger}}**{{{dataType}}}**{{/isInteger}}{{#isDouble}}**{{{dataType}}}**{{/isDouble}}{{#isFloat}}**{{{dataType}}}**{{/isFloat}}{{#isBoolean}}**{{dataType}}**{{/isBoolean}}{{#isEnum}}{{#isString}}**{{projectName}}_{{operationId}}_{{baseName}}_e**{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}**{{{dataType}}} \***{{/isString}}{{/isEnum}}{{#isByteArray}}**{{{dataType}}} \***{{/isByteArray}}{{#isDate}}**{{{dataType}}}**{{/isDate}}{{#isDateTime}}**{{{dataType}}}**{{/isDateTime}}{{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isFreeFormObject}}**[{{dataType}}_t]({{baseType}}.md) \***{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isArray}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}**{{datatypeWithEnum}}_e**{{/isEnum}}{{^isEnum}}**[{{{dataType}}}_t]({{{baseType}}}.md) \***{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}**{{datatypeWithEnum}}_e**{{/isEnum}}{{/isModel}}{{#isUuid}}**{{dataType}} \***{{/isUuid}}{{#isEmail}}**{{dataType}}**{{/isEmail}}{{/isPrimitiveType}}{{/isArray}}{{#isContainer}}{{#isArray}}**[{{dataType}}_t]({{baseType}}.md) \***{{/isArray}}{{#isMap}}**{{dataType}}**{{/isMap}}{{/isContainer}} | {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +**{{paramName}}** | {{#isPrimitiveType}}{{#isNumber}}**{{{dataType}}}**{{/isNumber}}{{#isLong}}**{{{dataType}}}**{{/isLong}}{{#isInteger}}**{{{dataType}}}**{{/isInteger}}{{#isDouble}}**{{{dataType}}}**{{/isDouble}}{{#isFloat}}**{{{dataType}}}**{{/isFloat}}{{#isBoolean}}**{{dataType}}**{{/isBoolean}}{{#isEnum}}{{#isString}}**{{projectName}}_{{operationId}}_{{baseName}}_e**{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}**{{{dataType}}} \***{{/isString}}{{/isEnum}}{{#isByteArray}}**{{{dataType}}} \***{{/isByteArray}}{{#isDate}}**{{{dataType}}}**{{/isDate}}{{#isDateTime}}**{{{dataType}}}**{{/isDateTime}}{{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isFreeFormObject}}**[{{dataType}}_t]({{baseType}}.md) \***{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isArray}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}**{{datatypeWithEnum}}_e**{{/isEnum}}{{^isEnum}}**[{{{dataType}}}_t]({{{baseType}}}.md) \***{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}**{{datatypeWithEnum}}_e**{{/isEnum}}{{/isModel}}{{#isUuid}}**{{dataType}} \***{{/isUuid}}{{#isEmail}}**{{dataType}}**{{/isEmail}}{{/isPrimitiveType}}{{/isArray}}{{#isContainer}}{{#isArray}}**[{{dataType}}_t]({{baseType}}.md) \***{{/isArray}}{{#isMap}}**{{dataType}}**{{/isMap}}{{/isContainer}} | {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model_test.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model_test.mustache index e7c0a817cd9e..7da1371819e2 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model_test.mustache @@ -27,14 +27,14 @@ {{classname}}_t* {{classname}} = NULL; if (include_optional) { {{classname}} = {{classname}}_create( -{{#vars}} {{#isEnum}}{{^isContainer}}{{#example}}{{projectName}}_{{classVarName}}_{{enumName}}_{{{.}}}{{/example}}{{/isContainer}}{{#isContainer}}{{#example}}{{{.}}}{{/example}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{#example}}{{{.}}}{{/example}}{{/isEnum}}{{^example}}{{#isModel}}{{#isEnum}}// enum {{datatypeWithEnum}}_e Work in Progress +{{#vars}} {{#isEnum}}{{^isContainer}}{{#example}}{{projectName}}_{{classVarName}}_{{enumName}}_{{{.}}}{{/example}}{{/isContainer}}{{#isContainer}}{{{example}}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{example}}}{{/isEnum}}{{^example}}{{#isModel}}{{#isEnum}}// enum {{datatypeWithEnum}}_e Work in Progress {{/isEnum}}{{^isEnum}} // false, not to have infinite recursion instantiate_{{{dataType}}}(0){{/isEnum}}{{/isModel}}{{^isModel}}0{{/isModel}}{{/example}}{{^-last}},{{/-last}} {{/vars}} ); } else { {{classname}} = {{classname}}_create( -{{#vars}} {{#isEnum}}{{^isContainer}}{{#example}}{{projectName}}_{{classVarName}}_{{enumName}}_{{{.}}}{{/example}}{{/isContainer}}{{#isContainer}}{{#example}}{{{.}}}{{/example}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{#example}}{{{.}}}{{/example}}{{/isEnum}}{{^example}}{{#isModel}}{{#isEnum}}// enum {{datatypeWithEnum}}_e Work in Progress +{{#vars}} {{#isEnum}}{{^isContainer}}{{#example}}{{projectName}}_{{classVarName}}_{{enumName}}_{{{.}}}{{/example}}{{/isContainer}}{{#isContainer}}{{{example}}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{example}}}{{/isEnum}}{{^example}}{{#isModel}}{{#isEnum}}// enum {{datatypeWithEnum}}_e Work in Progress {{/isEnum}}{{^isEnum}}NULL{{/isEnum}}{{/isModel}}{{^isModel}}0{{/isModel}}{{/example}}{{^-last}},{{/-last}} {{/vars}} ); diff --git a/modules/openapi-generator/src/main/resources/Eiffel/README.mustache b/modules/openapi-generator/src/main/resources/Eiffel/README.mustache index 0d292c5d720d..54459f5fd812 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/README.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/README.mustache @@ -1,7 +1,7 @@ # Eiffel API client for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview @@ -29,7 +29,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models @@ -43,7 +43,7 @@ Class | Method | HTTP request | Description {{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} {{#authMethods}}## {{{name}}} -{{#isApiKey}}- **Type**: API key +{{#isApiKey}}- **Type**: API key - **API key parameter name**: {{{keyParamName}}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} diff --git a/modules/openapi-generator/src/main/resources/Eiffel/api.mustache b/modules/openapi-generator/src/main/resources/Eiffel/api.mustache index be029f379d39..7479b9dcd9fd 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/api.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/api.mustache @@ -13,25 +13,25 @@ feature -- API Access {{#operation}} - {{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}}{{#isPrimitiveType}}{{{dataType}}}{{/isPrimitiveType}}{{^isPrimitiveType}}detachable {{{dataType}}}{{/isPrimitiveType}}{{/required}}{{^-last}}; {{/-last}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{returnType}}}{{/returnType}}{{^returnType}}{{/returnType}} + {{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}}{{#isPrimitiveType}}{{{dataType}}}{{/isPrimitiveType}}{{^isPrimitiveType}}detachable {{{dataType}}}{{/isPrimitiveType}}{{/required}}{{^-last}}; {{/-last}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{.}}}{{/returnType}} -- {{summary}} -- {{notes}} -- {{#allParams}} -- argument: {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} -- {{/allParams}} -- {{#returnType}} - -- Result {{returnType}}{{/returnType}} + -- Result {{.}}{{/returnType}} require - {{#allParams}} + {{#allParams}} {{#hasValidation}} {{#maximum}} - {{{paramName}}}_is_less_or_equal_than: {{{paramName}}} <= {{{maximum}}} + {{{paramName}}}_is_less_or_equal_than: {{{paramName}}} <= {{{maximum}}} {{/maximum}} {{#minimum}} - {{{paramName}}}_is_greater_or_equal_than: {{{paramName}}} >= {{{minimum}}} + {{{paramName}}}_is_greater_or_equal_than: {{{paramName}}} >= {{{minimum}}} {{/minimum}} {{/hasValidation}} - {{/allParams}} + {{/allParams}} local l_path: STRING l_request: API_CLIENT_REQUEST @@ -45,7 +45,7 @@ feature -- API Access l_path.replace_substring_all ("{"+"{{baseName}}"+"}", api_client.url_encode ({{{paramName}}}.out)) {{/pathParams}} {{#queryParams}} - l_request.fill_query_params(api_client.parameter_to_tuple("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + l_request.fill_query_params(api_client.parameter_to_tuple("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}} @@ -65,7 +65,7 @@ feature -- API Access l_request.add_header(api_client.select_header_content_type ({ARRAY [STRING]}<<{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}>>),"Content-Type") l_request.set_auth_names ({ARRAY [STRING]}<<{{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}}>>) l_response := api_client.call_api (l_path, "{{httpMethod}}", l_request, {{#returnType}}Void{{/returnType}}{{^returnType}}agent serializer{{/returnType}}, {{#returnType}}agent deserializer{{/returnType}}{{^returnType}}Void{{/returnType}}) - {{#returnType}} + {{#returnType}} if l_response.has_error then last_error := l_response.error elseif attached { {{{returnType}}} } l_response.data ({ {{{returnType}}} }) as l_data then @@ -79,7 +79,7 @@ feature -- API Access last_error := l_response.error end {{/returnType}} - end + end {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/Eiffel/api_client.mustache b/modules/openapi-generator/src/main/resources/Eiffel/api_client.mustache index 1ca86a49e385..42899ca28c6d 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/api_client.mustache @@ -1,4 +1,4 @@ -{{>noteinfo}} +{{>noteinfo}} class API_CLIENT @@ -14,13 +14,13 @@ feature {NONE} -- Initialization set_base_path (default_base_path) --set default user_agent - set_user_agent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/Eiffel{{/httpUserAgent}}"); + set_user_agent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/Eiffel{{/httpUserAgent}}"); create authentications.make (3) {{#authMethods}}{{#isBasic}} - authentications.force (create {HTTP_BASIC_AUTH}, "{{name}}") + authentications.force (create {HTTP_BASIC_AUTH}, "{{name}}") is_basic_auth_configured := True {{/isBasic}}{{#isApiKey}} - authentications.force (create {API_KEY_AUTH}.make ({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"), "{{name}}") - is_api_key_configured := True {{/isApiKey}}{{#isOAuth}} + authentications.force (create {API_KEY_AUTH}.make ({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"), "{{name}}") + is_api_key_configured := True {{/isApiKey}}{{#isOAuth}} authentications.force (create {OAUTH},"{{name}}") is_oauth_configured := True {{/isOAuth}}{{/authMethods}} end @@ -42,7 +42,7 @@ feature -- Status Report -- is basic auth configured. is_api_key_configured: BOOLEAN - -- is api key auth configured. + -- is api key auth configured. is_oauth_configured: BOOLEAN -- is oauth configured. @@ -138,7 +138,7 @@ feature -- Query Parameter Helpers if attached {LIST [ANY]} a_value as a_list then -- Collection if a_list.is_empty then - -- Return an empty list + -- Return an empty list create {ARRAYED_LIST [TUPLE [name: STRING; value: STRING]]} Result.make (0) else -- collection format: multi, csv, ssv, tsv, pipes. @@ -312,7 +312,7 @@ feature --Helper: Http Client -- Url encode `a_val' do Result := (create {URL_ENCODER}).encoded_string (a_val) - end + end feature -- HTTP client: call api @@ -373,9 +373,9 @@ feature -- HTTP client: call api then -- Serialize an object `a_body' to content-type `l_type' -- if not support by default you will need to extend - -- the target API with the corresponding implementation. + -- the target API with the corresponding implementation. l_context_executor.set_upload_data((create {API_SERIALIZER}).serializer (l_custom_serializer, l_content_type, l_body)) - end + end end if @@ -514,7 +514,7 @@ feature {NONE} -- Implementation sess.set_is_debug (True) end debug ("proxy8888") - sess.set_proxy ("127.0.0.1", 8888) --| inspect traffic with http://www.fiddler2.com/ + sess.set_proxy ("127.0.0.1", 8888) --| inspect traffic with http://www.fiddler2.com/ end end end diff --git a/modules/openapi-generator/src/main/resources/Eiffel/api_doc.mustache b/modules/openapi-generator/src/main/resources/Eiffel/api_doc.mustache index 461ee1047aa3..01382a9c77ab 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/api_doc.mustache @@ -1,29 +1,29 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Feature | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}} detachable {{{dataType}}}{{/required}} {{^-last}}; {{/-last}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{returnType}}}{{/returnType}}{{^returnType}}{{/returnType}} - +> {{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}} detachable {{{dataType}}}{{/required}} {{^-last}}; {{/-last}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{.}}}{{/returnType}} + {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Eiffel/ecf.mustache b/modules/openapi-generator/src/main/resources/Eiffel/ecf.mustache index 13720007773f..3f0b5f7f5e1a 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/ecf.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/ecf.mustache @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@ + diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/api_client_request.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/api_client_request.mustache index 53aa9a63eed0..9ca03c295f73 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/api_client_request.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/api_client_request.mustache @@ -52,22 +52,22 @@ feature -- Change Element -- with `key'. do header_params.force (new, key) - end + end add_form (new: ANY; key: READABLE_STRING_GENERAL) -- Update `form_params' so that `new' will be the item associated -- with `key'. do form_params.force (new, key) - end + end set_body (a_body: like body) -- Set 'body' with 'a_body'. do body := a_body ensure - body_set: body = a_body - end + body_set: body = a_body + end set_auth_names (a_auth_names: like auth_names) -- Set 'auth_names' with 'a_auth_names'. @@ -75,5 +75,5 @@ feature -- Change Element auth_names := a_auth_names ensure auth_names_set: auth_names = a_auth_names - end + end end diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/api_i.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/api_i.mustache index 6b09f4c639ea..e358ab661fee 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/api_i.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/api_i.mustache @@ -84,7 +84,7 @@ feature -- Deserializer create err err.set_description ("Deserialization is not supported by default you will need to add it by hand.") err.raise - end + end end diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/authentication.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/authentication.mustache index 9367ba5eee92..6389ccf9f95e 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/authentication.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/authentication.mustache @@ -1,4 +1,4 @@ -{{>noteinfo}} +{{>noteinfo}} deferred class AUTHENTICATION diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/http_basic_auth.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/http_basic_auth.mustache index 4df2e875fe42..f3f6c126e633 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/http_basic_auth.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/http_basic_auth.mustache @@ -15,7 +15,7 @@ feature -- Access password: detachable STRING_32 -- Password. -feature -- Element Change +feature -- Element Change set_user_name (a_name: STRING_32) -- Set `user_name' with `a_name'. diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/api_json_custom_deserializer.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/api_json_custom_deserializer.mustache index 393d291f05de..b8db90a81a57 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/api_json_custom_deserializer.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/api_json_custom_deserializer.mustache @@ -2,37 +2,37 @@ note description: "[ Object Helper to deserialize a string in JSON format to an object in the domain model How to write a converter. Suppose we have the following class - + PERSON - id: INTEGER_64 + id: INTEGER_64 name: STRING address: ADDRESS hobbies: LIST [STRING] photos: LIST [PHOTOS] - + conversion: First go to the feature from_json_to_`model' and then start to set the object attibures as follow. - + STRING, INTEGER, etc use the following pattern - + Result.set_id (integer_64_value_from_json (a_json, "id")) Result.set_name (string_value_from_json (a_json, "name")) - + OBJECTS When you have an attribute that's an object itself (part of the domain) you will need to first get JSON_OBJECT to the corresponding attribute and then use the related feature `from_json_to_model' in this case from_json_to_address (l_address) - + if attached {JSON_OBJECT} json_value (a_json, "address") as l_address then Result.set_address(from_json_to_address (l_address)) - end - + end + LIST [STRING] or other simple types. - + In the case of a list of string we need to do something similar but we need to traverse the array We will need a local variable to build the lists. - + if attached {JSON_ARRAY} json_value (a_json, "hobbies") as l_array then create {ARRAYED_LIST [STRING]} l_hobbies.make (l_array.count) across l_array as ic loop @@ -41,13 +41,13 @@ note end end Result.set_hobbies (l_hobbies) - end - + end + LIST [PHOTOS] This case is similar to the previous, but in this case the element is - an object, so we will need to use the feature `from_json_to_model', here + an object, so we will need to use the feature `from_json_to_model', here we again need a local variable to build a temporary list of photos. - + if attached {JSON_ARRAY} json_value (a_json, "photos") as l_array then create {ARRAYED_LIST [PHOTOS]} l_photos.make (l_array.count) across diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_basic_reflector_deserializer.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_basic_reflector_deserializer.mustache index 3a6f2b04c8bb..ebd05951b38d 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_basic_reflector_deserializer.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_basic_reflector_deserializer.mustache @@ -50,7 +50,7 @@ feature -- Cleaning fields_infos_by_type_id := Void end -feature {NONE} -- Helpers : Array +feature {NONE} -- Helpers : Array reference_from_json_array (a_json: JSON_ARRAY; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable ANY do @@ -263,7 +263,7 @@ feature {NONE} -- Helpers : Array end end -feature {NONE} -- Helpers: Object +feature {NONE} -- Helpers: Object type_name_from_json_object (a_json_object: JSON_OBJECT): detachable READABLE_STRING_32 do @@ -364,7 +364,7 @@ feature {NONE} -- Helpers: Object end end -feature {NONE} -- Helpers: Basic values +feature {NONE} -- Helpers: Basic values boolean_from_json (v: JSON_VALUE): BOOLEAN do diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_type_utilities_ext.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_type_utilities_ext.mustache index bcc1c27d28fe..3424f270afbb 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_type_utilities_ext.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_type_utilities_ext.mustache @@ -11,7 +11,7 @@ inherit JSON_TYPE_UTILITIES -feature -- Factory +feature -- Factory new_special_for_name (a_type_name: READABLE_STRING_GENERAL; count: INTEGER): detachable SPECIAL [detachable ANY] do diff --git a/modules/openapi-generator/src/main/resources/Eiffel/model.mustache b/modules/openapi-generator/src/main/resources/Eiffel/model.mustache index 3d00ca47b4f6..b1f66ca0cf3c 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/model.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/model.mustache @@ -1,4 +1,4 @@ -class {{classname}} +class {{classname}} {{#parent}} inherit @@ -7,15 +7,15 @@ inherit {{#parent}} {{{parent}}} - {{^isPrimitiveType}} + {{^isPrimitiveType}} {{^isMap}} {{^isArray}} rename - output as out_{{{parentSchema}}} + output as out_{{{parentSchema}}} end {{/isArray}} {{/isMap}} - {{/isPrimitiveType}} + {{/isPrimitiveType}} {{/parent}} feature --Access @@ -24,31 +24,31 @@ feature --Access {{^isInherited}} {{#isPrimitiveType}} {{^isContainer}} - {{name}}: {{{dataType}}} - {{#description}}-- {{{description}}}{{/description}} - {{/isContainer}} + {{name}}: {{{dataType}}} + {{#description}}-- {{{.}}}{{/description}} + {{/isContainer}} {{/isPrimitiveType}} {{#isPrimitiveType}} {{#isContainer}} - {{name}}: detachable {{{datatypeWithEnum}}} - {{#description}}-- {{{description}}}{{/description}} - {{/isContainer}} + {{name}}: detachable {{{datatypeWithEnum}}} + {{#description}}-- {{{.}}}{{/description}} + {{/isContainer}} {{/isPrimitiveType}} {{^isPrimitiveType}} {{#isContainer}} - {{name}}: detachable {{{datatypeWithEnum}}} - {{#description}}-- {{{description}}}{{/description}} + {{name}}: detachable {{{datatypeWithEnum}}} + {{#description}}-- {{{.}}}{{/description}} {{/isContainer}} {{^isContainer}} - {{name}}: detachable {{{dataType}}} - {{#description}}-- {{{description}}}{{/description}} + {{name}}: detachable {{{dataType}}} + {{#description}}-- {{{.}}}{{/description}} {{/isContainer}} {{/isPrimitiveType}} {{/isInherited}} {{/vars}} -feature -- Change Element - +feature -- Change Element + {{#vars}} {{^isInherited}} set_{{name}} (a_name: like {{name}}) @@ -56,7 +56,7 @@ feature -- Change Element do {{name}} := a_name ensure - {{name}}_set: {{name}} = a_name + {{name}}_set: {{name}} = a_name end {{/isInherited}} @@ -72,7 +72,7 @@ feature -- Change Element Result.append(out_{{{parentSchema}}}) {{/parent}} Result.append("%Nclass {{classname}}%N") - {{#vars}} + {{#vars}} {{^isInherited}} {{#isArray}} if attached {{name}} as l_{{name}} then @@ -81,7 +81,7 @@ feature -- Change Element Result.append (ic.item.out) Result.append ("%N") end - end + end {{/isArray}} {{#isMap}} if attached {{name}} as l_{{name}} then @@ -95,14 +95,14 @@ feature -- Change Element Result.append (ic.item.out) Result.append ("%N") end - end + end {{/isMap}} {{^isContainer}} if attached {{name}} as l_{{name}} then Result.append ("%N{{name}}:") Result.append (l_{{name}}.out) - Result.append ("%N") - end + Result.append ("%N") + end {{/isContainer}} {{/isInherited}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/Eiffel/model_enum.mustache b/modules/openapi-generator/src/main/resources/Eiffel/model_enum.mustache index 7ec1a444db7d..7ae3596874e9 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/model_enum.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/model_enum.mustache @@ -1,4 +1,4 @@ -class {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} +class {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} feature -- Access diff --git a/modules/openapi-generator/src/main/resources/Eiffel/model_generic.mustache b/modules/openapi-generator/src/main/resources/Eiffel/model_generic.mustache index 1a83370f8d2e..ef236e97f38e 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/model_generic.mustache @@ -4,4 +4,3 @@ {{#isEnum}}{{>model_enum}}{{/isEnum}}{{^isEnum}}{{>model}}{{/isEnum}} {{/model}} {{/models}} - diff --git a/modules/openapi-generator/src/main/resources/Eiffel/noteinfo.mustache b/modules/openapi-generator/src/main/resources/Eiffel/noteinfo.mustache index 505596b9e974..c3d9f2eeab4a 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/noteinfo.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/noteinfo.mustache @@ -2,8 +2,8 @@ note description:"[ {{{appName}}} {{{appDescription}}} - {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/modules/openapi-generator/src/main/resources/Eiffel/test/api_test.mustache b/modules/openapi-generator/src/main/resources/Eiffel/test/api_test.mustache index c84e3ade1c6f..efe2ddd5cda7 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/test/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/test/api_test.mustache @@ -14,14 +14,14 @@ feature -- Test routines {{#operations}} {{#operation}} - + test_{{operationId}} -- {{summary}} - -- - -- {{notes}} + -- + -- {{notes}} local {{#returnType}} - l_response: {{{returnType}}} + l_response: {{{.}}} {{/returnType}} {{#allParams}} l_{{paramName}}: {{{dataType}}} @@ -37,10 +37,10 @@ feature -- Test routines {{/isContainer}} {{^isContainer}} -- l_{{paramName}} - {{/isContainer}} + {{/isContainer}} {{/required}} {{/allParams}} - + {{#returnType}} -- l_response := api.{{operationId}}{{#hasParams}}({{#allParams}}l_{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{/hasParams}} {{/returnType}} @@ -56,7 +56,7 @@ feature {NONE} -- Implementation api: {{classname}} -- Create an object instance of `{{classname}}'. - once + once create { {{classname}} } Result end diff --git a/modules/openapi-generator/src/main/resources/Eiffel/test/ecf_test.mustache b/modules/openapi-generator/src/main/resources/Eiffel/test/ecf_test.mustache index 5e3d279e0b44..83d854d0836c 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/test/ecf_test.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/test/ecf_test.mustache @@ -10,7 +10,7 @@ + diff --git a/modules/openapi-generator/src/main/resources/Eiffel/travis.mustache b/modules/openapi-generator/src/main/resources/Eiffel/travis.mustache index 563530f458aa..8d59017085dd 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/travis.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/travis.mustache @@ -6,11 +6,10 @@ before_script: - source ./eiffel.rc - echo `ec -version` - cd $current_dir - + # safelist branches: only: - master script: compile_all -ecb -melt -list_failures -clean -options dotnet=false - diff --git a/modules/openapi-generator/src/main/resources/Groovy/README.mustache b/modules/openapi-generator/src/main/resources/Groovy/README.mustache index 04ecc57787f0..069ad55624bc 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/README.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/README.mustache @@ -1,14 +1,14 @@ # {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This Groovy package, using the [http-builder-ng library](https://http-builder-ng.github.io/http-builder-ng/), is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} {{#artifactVersion}} -- Package version: {{artifactVersion}} +- Package version: {{.}} {{/artifactVersion}} {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} @@ -48,7 +48,7 @@ def apiInstance = new {{classname}}() apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { // on success - {{#returnType}}def result = ({{returnType}})it + {{#returnType}}def result = ({{.}})it println result {{/returnType}} {{^returnType}}println it{{/returnType}} diff --git a/modules/openapi-generator/src/main/resources/Groovy/api.mustache b/modules/openapi-generator/src/main/resources/Groovy/api.mustache index 9829023e5f17..a7ee609852e1 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/api.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/api.mustache @@ -73,7 +73,7 @@ class {{classname}} { apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, "{{httpMethod}}", "{{returnContainer}}", - {{#returnBaseType}}{{{returnBaseType}}}.class {{/returnBaseType}}{{^returnBaseType}}null {{/returnBaseType}}) + {{#returnBaseType}}{{{.}}}.class {{/returnBaseType}}{{^returnBaseType}}null {{/returnBaseType}}) } diff --git a/modules/openapi-generator/src/main/resources/Groovy/model.mustache b/modules/openapi-generator/src/main/resources/Groovy/model.mustache index e1821824d791..00cedcfd15a8 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/model.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/model.mustache @@ -10,8 +10,8 @@ import {{import}}; @Canonical class {{classname}} { {{#vars}} - {{#description}}/* {{{description}}} */{{/description}} - {{{dataType}}} {{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} + {{#description}}/* {{{.}}} */{{/description}} + {{{dataType}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}} {{/vars}} } {{/model}} diff --git a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache index d75e455961c5..d00284aff9a5 100644 --- a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache @@ -140,7 +140,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { dateFormat = ApiClient.buildDefaultDateFormat(); // Set default User-Agent. - setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} diff --git a/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache b/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache index ab8ef30b69be..3fc5b8451213 100644 --- a/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache +++ b/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache @@ -7,7 +7,7 @@ import javax.validation.ValidationException; public class BeanValidationException extends ValidationException { /** - * + * */ private static final long serialVersionUID = -5294733947409491364L; Set> violations; diff --git a/modules/openapi-generator/src/main/resources/Java/README.mustache b/modules/openapi-generator/src/main/resources/Java/README.mustache index fd9abd282417..cd2c7af3ee8b 100644 --- a/modules/openapi-generator/src/main/resources/Java/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/README.mustache @@ -8,7 +8,7 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) @@ -157,7 +157,7 @@ public class {{{classname}}}Example { {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} System.out.println(result);{{/returnType}} } catch (ApiException e) { System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); @@ -177,7 +177,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Java/api.mustache b/modules/openapi-generator/src/main/resources/Java/api.mustache index 894cb0112398..28b18e2d16fb 100644 --- a/modules/openapi-generator/src/main/resources/Java/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/api.mustache @@ -49,7 +49,7 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} {{/allParams}} {{#returnType}} - * @return {{returnType}} + * @return {{.}} {{/returnType}} * @throws ApiException if fails to make API call {{#isDeprecated}} @@ -63,7 +63,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -83,7 +83,7 @@ public class {{classname}} { {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); {{#queryParams}} - {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}}if ({{paramName}} != null) diff --git a/modules/openapi-generator/src/main/resources/Java/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/api_doc.mustache index 55d0244e3a52..78783f1943e5 100644 --- a/modules/openapi-generator/src/main/resources/Java/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/api_doc.mustache @@ -1,12 +1,12 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{operationId}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -60,7 +60,7 @@ public class Example { {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} System.out.println(result);{{/returnType}} } catch (ApiException e) { System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); @@ -78,7 +78,7 @@ public class Example { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Java/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/api_test.mustache index 38c58efb7117..b3a544d4c658 100644 --- a/modules/openapi-generator/src/main/resources/Java/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/api_test.mustache @@ -27,11 +27,11 @@ public class {{classname}}Test { {{#operation}} /** {{#summary}} - * {{summary}} + * {{.}} * {{/summary}} {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} * @throws ApiException @@ -42,7 +42,7 @@ public class {{classname}}Test { //{{#allParams}} //{{{dataType}}} {{paramName}} = null; //{{/allParams}} - //{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache b/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache index 07b7f3aa673d..05bbf28dd3b1 100644 --- a/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache +++ b/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache @@ -5,7 +5,7 @@ package {{invokerPackage}}.auth; {{>generatedAnnotation}} public enum OAuthFlow { accessCode, //called authorizationCode in OpenAPI 3.0 - implicit, + implicit, password, application //called clientCredentials in OpenAPI 3.0 } diff --git a/modules/openapi-generator/src/main/resources/Java/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/Java/beanValidationCore.mustache index 1f9f43e7b868..ff4ffe26c497 100644 --- a/modules/openapi-generator/src/main/resources/Java/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/Java/beanValidationCore.mustache @@ -4,17 +4,17 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/Java/beanValidationQueryParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/Java/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/Java/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index 95fc41cbf42a..70dea8f3f25a 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -105,7 +105,7 @@ if(hasProperty('target') && target == 'android') { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } - + task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource @@ -164,4 +164,3 @@ dependencies { implementation 'javax.annotation:javax.annotation-api:1.3.2' testImplementation "junit:junit:$junit_version" } - diff --git a/modules/openapi-generator/src/main/resources/Java/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/Java/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100755 --- a/modules/openapi-generator/src/main/resources/Java/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/Java/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache index 3819d3d2dd2e..ccde126f54eb 100644 --- a/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache +++ b/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache @@ -8,12 +8,12 @@ @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) {{#withXml}} {{^isContainer}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isContainer}} {{#isContainer}} {{#isXmlWrapped}} // items.xmlName={{items.xmlName}} - @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") + @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") {{/isXmlWrapped}} {{/isContainer}} {{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache index e0d3e01c3864..20c8733c9d08 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -259,7 +259,7 @@ public class ApiClient { {{#hasOAuthMethods}} /** - * Helper method to configure the client credentials for Oauth + * Helper method to configure the client credentials for Oauth * @param username Username * @param password Password */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/README.mustache index acab659406d0..fed3cbebd53c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/README.mustache @@ -54,7 +54,7 @@ And to use the api you can follow the examples bellow: ApiClient apiClient = new ApiClient("oauth_password"); apiClient.setBasePath("https://localhost:8243/petstore/1/"); apiClient.setOauthPassword("username", "password", "client_id", "client_secret"); - + //Oauth client credentials flow ApiClient apiClient = new ApiClient("oauth_client_credentials"); apiClient.setBasePath("https://localhost:8243/petstore/1/"); @@ -62,7 +62,7 @@ And to use the api you can follow the examples bellow: PetApi petApi = apiClient.buildClient(PetApi.class); Pet petById = petApi.getPetById(12345L); - + System.out.println(petById); } ``` diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache index 5a5012d63ab4..de0ae82baaa2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache @@ -28,7 +28,7 @@ public interface {{classname}} extends ApiClient.Api { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} {{#returnType}} - * @return {{returnType}} + * @return {{.}} {{/returnType}} {{#externalDocs}} * {{description}} @@ -48,7 +48,7 @@ public interface {{classname}} extends ApiClient.Api { "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#hasQueryParams}} /** @@ -72,7 +72,7 @@ public interface {{classname}} extends ApiClient.Api { {{/queryParams}} * {{#returnType}} - * @return {{returnType}} + * @return {{.}} {{/returnType}} {{#externalDocs}} * {{description}} @@ -92,7 +92,7 @@ public interface {{classname}} extends ApiClient.Api { "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map queryParams); + {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache index e9f9d055e02f..a7f5bb0b328a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache @@ -36,7 +36,7 @@ class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - // {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + // {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } @@ -61,7 +61,7 @@ class {{classname}}Test { {{#queryParams}} .{{paramName}}(null){{#-last}};{{/-last}} {{/queryParams}} - // {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams); + // {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/HttpBasicAuth.mustache index 2b1acb8ff74c..c308131e8f94 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/HttpBasicAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/HttpBasicAuth.mustache @@ -11,7 +11,7 @@ public class HttpBasicAuth implements RequestInterceptor { private String username; private String password; - + public String getUsername() { return username; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index 65b3cc3c2146..28b5437ccc0c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -225,7 +225,7 @@ jsr305 3.0.2 - + io.github.openfeign diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache index 8396e3148bcf..f9af1a4a9bb6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache @@ -45,11 +45,11 @@ public class {{classname}} { {{#operation}} /**{{#summary}} - * {{summary}}{{/summary}}{{#notes}} - * {{notes}}{{/notes}}{{#responses}} - *

{{code}}{{#message}} - {{message}}{{/message}}{{/responses}}{{#allParams}} + * {{.}}{{/summary}}{{#notes}} + * {{.}}{{/notes}}{{#responses}} + *

{{code}}{{#message}} - {{.}}{{/message}}{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}}{{/allParams}}{{#returnType}} - * @return {{returnType}}{{/returnType}} + * @return {{.}}{{/returnType}} * @throws IOException if an error occurs while attempting to invoke the API{{#externalDocs}} * {{description}} * @see {{summary}} Documentation @@ -61,19 +61,19 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws IOException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws IOException { {{#returnType}}HttpResponse response = {{/returnType}}{{operationId}}ForHttpResponse({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} TypeReference<{{{returnType}}}> typeRef = new TypeReference<{{{returnType}}}>() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);{{/returnType}} } /**{{#summary}} - * {{summary}}{{/summary}}{{#notes}} - * {{notes}}{{/notes}}{{#responses}} - *

{{code}}{{#message}} - {{message}}{{/message}}{{/responses}}{{#requiredParams}} + * {{.}}{{/summary}}{{#notes}} + * {{.}}{{/notes}}{{#responses}} + *

{{code}}{{#message}} - {{.}}{{/message}}{{/responses}}{{#requiredParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}}{{/requiredParams}} * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.{{#returnType}} - * @return {{returnType}}{{/returnType}} + * @return {{.}}{{/returnType}} * @throws IOException if an error occurs while attempting to invoke the API{{#externalDocs}} * {{description}} * @see {{summary}} Documentation @@ -85,7 +85,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#bodyParam}}{{^required}}{{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map params) throws IOException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#bodyParam}}{{^required}}{{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map params) throws IOException { {{#returnType}}HttpResponse response = {{/returnType}}{{operationId}}ForHttpResponse({{#bodyParam}}{{^required}}{{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}params);{{#returnType}} TypeReference<{{{returnType}}}> typeRef = new TypeReference<{{{returnType}}}>() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);{{/returnType}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache index 56b7c1897d14..1dc2f174fbf2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache @@ -37,7 +37,7 @@ public class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index 6be8600c7dac..6abca3fddb7b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -24,7 +24,7 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' - + android { compileSdkVersion 23 buildToolsVersion '23.0.2' @@ -42,7 +42,7 @@ if(hasProperty('target') && target == 'android') { targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} } - + // Rename the aar correctly libraryVariants.all { variant -> variant.outputs.each { output -> @@ -58,7 +58,7 @@ if(hasProperty('target') && target == 'android') { provided 'javax.annotation:jsr250-api:1.0' } } - + afterEvaluate { android.libraryVariants.all { variant -> def task = project.tasks.create "jar${variant.name.capitalize()}", Jar @@ -70,12 +70,12 @@ if(hasProperty('target') && target == 'android') { artifacts.add('archives', task); } } - + task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } - + artifacts { archives sourcesJar } @@ -99,7 +99,7 @@ if(hasProperty('target') && target == 'android') { pom.artifactId = '{{artifactId}}' } } - + task execute(type:JavaExec) { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index 65494e8ea04a..abe9b208c60d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -188,7 +188,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { this.dateFormat = new RFC3339DateFormat(); // Set default User-Agent. - setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap(); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache index 666430c834e1..ec4d939d2fce 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache @@ -58,7 +58,7 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} - * @return {{returnType}} + * @return {{.}} {{/returnType}} * @throws ApiException if fails to make API call {{#responses.0}} @@ -81,7 +81,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { {{#returnType}}return {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}.getData(){{/returnType}}; } {{/vendorExtensions.x-group-parameters}} @@ -93,7 +93,7 @@ public class {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> * @throws ApiException if fails to make API call {{#responses.0}} * @http.response.details @@ -115,7 +115,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -134,7 +134,7 @@ public class {{classname}} { {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); {{#queryParams}} - localVarQueryParams.addAll(apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}}if ({{paramName}} != null) @@ -212,13 +212,13 @@ public class {{classname}} { {{#isDeprecated}}* @deprecated{{/isDeprecated}} */ {{#isDeprecated}}@Deprecated{{/isDeprecated}} - public {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} execute() throws ApiException { + public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { {{#returnType}}return {{/returnType}}this.executeWithHttpInfo().getData(); } /** * Execute {{operationId}} request with HTTP info returned - * @return ApiResponse<{{#returnType}}{{.}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> * @throws ApiException if fails to make API call {{#responses.0}} * @http.response.details @@ -235,7 +235,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { + public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_doc.mustache index e9270ceb18f1..3877e9ab3af7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_doc.mustache @@ -1,12 +1,12 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -15,10 +15,10 @@ Method | HTTP request | Description ## {{operationId}} {{^vendorExtensions.x-group-parameters}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}.execute(); +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}.execute(); {{/vendorExtensions.x-group-parameters}} {{summary}}{{#notes}} @@ -69,10 +69,10 @@ public class Example { {{/allParams}} try { {{^vendorExtensions.x-group-parameters}} - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} - {{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} .execute(); {{/vendorExtensions.x-group-parameters}} @@ -95,7 +95,7 @@ public class Example { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache index b6ea89f61546..c325e3d1ed2f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache @@ -41,10 +41,10 @@ public class {{classname}}Test { //{{{dataType}}} {{paramName}} = null; {{/allParams}} {{^vendorExtensions.x-group-parameters}} - //{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} - //{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} // .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} // .execute(); {{/vendorExtensions.x-group-parameters}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache index 55dc3717100f..b01a88a6646a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache @@ -1,9 +1,9 @@ /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} @Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{description}}}"){{/description}} +@ApiModel(description = "{{{.}}}"){{/description}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} @@ -12,7 +12,7 @@ }) {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} -public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -38,21 +38,21 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/jackson}} {{#withXml}} {{#isXmlAttribute}} - @XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isXmlAttribute}} {{^isXmlAttribute}} {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isContainer}} {{#isContainer}} // Is a container wrapped={{isXmlWrapped}} {{#items}} // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/items}} {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isXmlWrapped}} {{/isContainer}} {{/isXmlAttribute}} @@ -177,16 +177,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/isReadOnly}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} {{#deprecated}} @@ -207,7 +207,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{^required}} @javax.annotation.Nullable {{/required}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache index 8d126ada313b..58d2d5f5c18c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache @@ -1,7 +1,7 @@ # {{appName}} - MicroProfile Rest Client {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache index a13427c6965b..175467a4a981 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache @@ -23,7 +23,7 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; * {{{appName}}} * {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} * {{/appDescription}} */ @@ -41,7 +41,7 @@ public interface {{classname}} { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} {{#isDeprecated}} @@ -60,8 +60,7 @@ public interface {{classname}} { {{#hasProduces}} @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }) {{/hasProduces}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; {{/operation}} } {{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache index e0ed40ef88ba..43b5285b9674 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache @@ -23,10 +23,10 @@ import java.util.Map; /** {{#appName}} - * {{{appName}}} Test + * {{{.}}} Test * {{/appName}} - * API tests for {{classname}} + * API tests for {{classname}} */ {{#generateSpringBootApplication}} @RunWith(SpringJUnit4ClassRunner.class) @@ -38,7 +38,7 @@ public class {{classname}}Test { private {{classname}} client; private String baseUrl = "http://localhost:9080"; - + @Before public void setup() throws MalformedURLException { client = RestClientBuilder.newBuilder() @@ -53,7 +53,7 @@ public class {{classname}}Test { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} {{/summary}} @@ -66,10 +66,10 @@ public class {{classname}}Test { {{#allParams}} {{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}}{{#isFile}}org.apache.cxf.jaxrs.ext.multipart.Attachment {{paramName}} = null;{{/isFile}} {{/allParams}} - //{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); //{{#returnType}}assertNotNull(response);{{/returnType}} - - + + } {{/operation}}{{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationCore.mustache index 8bcdce3df16e..b58f0a266311 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationCore.mustache @@ -1,20 +1,20 @@ -{{#pattern}} @Pattern(regexp="{{{pattern}}}"){{/pattern}}{{! +{{#pattern}} @Pattern(regexp="{{{.}}}"){{/pattern}}{{! minLength && maxLength set }}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! -}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{.}}"){{/minimum}}{{#maximum}} @DecimalMax("{{.}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationHeaderParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationHeaderParams.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationHeaderParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationQueryParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumClass.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumClass.mustache index 87d5ee699a54..38127a63741e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumClass.mustache @@ -13,7 +13,7 @@ {{#enumVars}}@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/withXml}} {{^withXml}} - {{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} + {{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/withXml}} {{/allowableValues}} @@ -35,7 +35,7 @@ {{#withXml}} public static {{datatypeWithEnum}} fromValue(String v) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(v)) { return b; } @@ -47,7 +47,7 @@ public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { @Override public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(parser.getString())) { return b; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache index c56eca64b1e5..894ce951f389 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache @@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,14 +21,14 @@ import com.fasterxml.jackson.annotation.JsonValue; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @Override {{#jackson}} @JsonValue -{{/jackson}} +{{/jackson}} public String toString() { return String.valueOf(value); } @@ -36,13 +36,13 @@ import com.fasterxml.jackson.annotation.JsonValue; {{#jackson}} @JsonCreator {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(text)) { return b; } } {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + text + "'");{{/useNullForUnknownEnumValue}} } - + } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/licenseInfo.mustache index 9866f297a4d7..be193d0c4fe8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache index 183b60cc1ac1..13413bd16a00 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache @@ -30,11 +30,11 @@ import javax.json.bind.annotation.JsonbProperty; {{/withXml}} {{#description}} /** - * {{{description}}} + * {{{.}}} **/ {{/description}} {{>additionalModelTypeAnnotations}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} @@ -43,7 +43,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializ {{/withXml}} {{#description}} /** - * {{{description}}} + * {{{.}}} **/ {{/description}} {{^withXml}} @@ -56,20 +56,20 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{/vars}} - + {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} {{#deprecated}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache index b43a110aed7b..d1a4e5352dce 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache @@ -5,7 +5,7 @@ jar {{artifactId}} {{#appDescription}} - {{appDescription}} + {{.}} {{/appDescription}} {{artifactVersion}} @@ -125,7 +125,7 @@ activation 1.1.1 - + {{#java8}} com.fasterxml.jackson.datatype @@ -140,7 +140,7 @@ ${jackson-jaxrs-version} {{/java8}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} org.hibernate hibernate-validator diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/queryParams.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/queryParams.mustache index f89529fdb5dd..38bfb9ed06e7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{defaultValue}}}") {{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{.}}}") {{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/returnTypes.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/returnTypes.mustache index 6af86ffe4e4a..32f96a904720 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/returnTypes.mustache @@ -1,4 +1,4 @@ -{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: +{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: }}{{^useGenericResponse}}{{! }}{{{returnType}}}{{! }}{{/useGenericResponse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index ea46db7331d2..07ca35887247 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -375,7 +375,7 @@ public class ApiClient { this.readTimeout = readTimeout; return this; } - + /** * Get the read timeout that was set. * diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiResponse.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiResponse.mustache index 1f3f3a31981b..1e277319a936 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiResponse.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiResponse.mustache @@ -5,7 +5,7 @@ package {{invokerPackage}}; import java.util.List; import java.util.Map; {{#caseInsensitiveResponseHeaders}} -import java.util.Map.Entry; +import java.util.Map.Entry; import java.util.TreeMap; {{/caseInsensitiveResponseHeaders}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache index 0f6d46a460bd..ef15f379a13c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache @@ -8,7 +8,7 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) @@ -130,8 +130,8 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -*{{classname}}* | [**{{operationId}}WithHttpInfo**]({{apiDocPath}}{{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +*{{classname}}* | [**{{operationId}}WithHttpInfo**]({{apiDocPath}}{{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache index 35922945360a..b57129dcdb25 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache @@ -111,7 +111,7 @@ public class {{classname}} { * {{summary}} * {{notes}} * @param apiRequest {@link API{{operationId}}Request} - * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} + * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} * @throws ApiException if fails to make API call {{#isDeprecated}} * @deprecated @@ -124,7 +124,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo(API{{operationId}}Request apiRequest) throws ApiException { + public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo(API{{operationId}}Request apiRequest) throws ApiException { {{#allParams}} {{{dataType}}} {{paramName}} = apiRequest.{{paramName}}(); {{/allParams}} @@ -156,7 +156,7 @@ public class {{classname}} { {{/isDeprecated}} public {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}}{{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture{{/asyncNative}}{{^asyncNative}}void{{/asyncNative}}{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { {{^asyncNative}} - {{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}ApiResponse<{{{.}}}> localVarResponse = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#returnType}} return localVarResponse.getData(); {{/returnType}} @@ -196,7 +196,7 @@ public class {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} {{/allParams}} - * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} + * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} * @throws ApiException if fails to make API call {{#isDeprecated}} * @deprecated @@ -209,7 +209,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { {{^asyncNative}} HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); try { @@ -222,7 +222,7 @@ public class {{classname}} { if (localVarResponse.statusCode()/ 100 != 2) { throw getApiException("{{operationId}}", localVarResponse); } - return new ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>( + return new ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>( localVarResponse.statusCode(), localVarResponse.headers().map(), {{#returnType}}memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}){{/returnType}}{{^returnType}}null{{/returnType}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache index 23473757c364..3af38b33137f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache @@ -1,13 +1,13 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -[**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +[**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -24,7 +24,7 @@ Method | HTTP request | Description {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -100,7 +100,7 @@ public class Example { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{^vendorExtensions.x-group-parameters}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} @@ -136,15 +136,15 @@ Name | Type | Description | Notes ## {{operationId}}WithHttpInfo {{^vendorExtensions.x-group-parameters}} -> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} -> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#hasParams}}{{operationId}}Request{{/hasParams}}) +> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#hasParams}}{{operationId}}Request{{/hasParams}}) {{/vendorExtensions.x-group-parameters}} {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -192,7 +192,7 @@ public class Example { {{/allParams}} try { {{^vendorExtensions.x-group-parameters}} - {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} response = apiInstance.{{{operationId}}}WithHttpInfo({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} response = apiInstance.{{{operationId}}}WithHttpInfo({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} {{#hasParams}} @@ -200,7 +200,7 @@ public class Example { .{{paramName}}({{paramName}}){{/allParams}} .build(); {{/hasParams}} - {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} response = apiInstance.{{{operationId}}}WithHttpInfo({{#hasParams}}request{{/hasParams}}); + {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} response = apiInstance.{{{operationId}}}WithHttpInfo({{#hasParams}}request{{/hasParams}}); {{/vendorExtensions.x-group-parameters}} System.out.println("Status code: " + response{{#asyncNative}}.get(){{/asyncNative}}.getStatusCode()); System.out.println("Response headers: " + response{{#asyncNative}}.get(){{/asyncNative}}.getHeaders()); @@ -232,7 +232,7 @@ public class Example { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{^vendorExtensions.x-group-parameters}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} @@ -272,7 +272,7 @@ Name | Type | Description | Notes {{#allParams}}{{#-last}} | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} {{/hasParams}}{{/vendorExtensions.x-group-parameters}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache index 2db2da784e9c..20957c36c1f3 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache @@ -2,11 +2,11 @@ import {{invokerPackage}}.JSON; {{/discriminator}} /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} @Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{description}}}"){{/description}} +@ApiModel(description = "{{{.}}}"){{/description}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} @@ -15,7 +15,7 @@ import {{invokerPackage}}.JSON; }) {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} -public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -41,21 +41,21 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/jackson}} {{#withXml}} {{#isXmlAttribute}} - @XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isXmlAttribute}} {{^isXmlAttribute}} {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isContainer}} {{#isContainer}} // Is a container wrapped={{isXmlWrapped}} {{#items}} // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/items}} {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isXmlWrapped}} {{/isContainer}} {{/isXmlAttribute}} @@ -180,16 +180,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/isReadOnly}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} {{#deprecated}} @@ -210,7 +210,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{^required}} @javax.annotation.Nullable {{/required}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/travis.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/travis.mustache index d489da682e9e..c94647479234 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/travis.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/travis.mustache @@ -12,5 +12,5 @@ script: - mvn test # uncomment below to test using gradle # - gradle test - # uncomment below to test using sbt + # uncomment below to test using sbt # - sbt test diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 37ebae048308..8b47536b9e8b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -220,7 +220,7 @@ public class ApiClient { json = new JSON(); // Set default User-Agent. - setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); authentications = new HashMap(); {{#dynamicOperations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ProgressResponseBody.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ProgressResponseBody.mustache index 50f2eba395a3..45115940b665 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ProgressResponseBody.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ProgressResponseBody.mustache @@ -57,5 +57,3 @@ public class ProgressResponseBody extends ResponseBody { }; } } - - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache index 5b4ff7e38f50..dd21bcad45f0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache @@ -6,7 +6,7 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) @@ -114,7 +114,7 @@ public class Example { {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} .{{{paramName}}}({{{paramName}}}){{/optionalParams}} .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} System.out.println(result);{{/returnType}} @@ -136,7 +136,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index 6f71a36cd979..2a0f89e94f67 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -136,7 +136,7 @@ public class {{classname}} { {{^dynamicOperations}} {{#queryParams}} if ({{paramName}} != null) { - {{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); } {{/queryParams}} @@ -225,7 +225,7 @@ public class {{classname}} { * {{summary}} * {{notes}}{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}}{{#returnType}} - * @return {{returnType}}{{/returnType}} + * @return {{.}}{{/returnType}} * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body {{#responses.0}} * @http.response.details @@ -247,8 +247,8 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#returnType}}ApiResponse<{{{returnType}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} return localVarResp.getData();{{/returnType}} } {{/vendorExtensions.x-group-parameters}} @@ -257,7 +257,7 @@ public class {{classname}} { * {{summary}} * {{notes}}{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body {{#responses.0}} * @http.response.details @@ -279,7 +279,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType);{{/returnType}}{{^returnType}}return localVarApiClient.execute(localVarCall);{{/returnType}} @@ -312,7 +312,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}_callback); {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); @@ -374,7 +374,7 @@ public class {{classname}} { /** * Execute {{operationId}} request{{#returnType}} - * @return {{returnType}}{{/returnType}} + * @return {{.}}{{/returnType}} * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body {{#responses.0}} * @http.response.details @@ -392,14 +392,14 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} execute() throws ApiException { - {{#returnType}}ApiResponse<{{{returnType}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { + {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} return localVarResp.getData();{{/returnType}} } /** * Execute {{operationId}} request with HTTP info returned - * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body {{#responses.0}} * @http.response.details @@ -417,7 +417,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { + public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); } @@ -442,7 +442,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public okhttp3.Call executeAsync(final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { + public okhttp3.Call executeAsync(final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { return {{operationId}}Async({{#allParams}}{{paramName}}, {{/allParams}}_callback); } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_doc.mustache index 332088661a9b..5a4e3969c93d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_doc.mustache @@ -1,23 +1,23 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{operationId}}**{{^vendorExtensions.x-group-parameters}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example ```java @@ -58,7 +58,7 @@ public class Example { {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} .{{{paramName}}}({{{paramName}}}){{/optionalParams}} .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} System.out.println(result);{{/returnType}} @@ -77,7 +77,7 @@ public class Example { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache index 050bf8617d60..2daa8f44dda6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache @@ -37,7 +37,7 @@ public class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} .{{paramName}}({{paramName}}){{/optionalParams}} .execute();{{/vendorExtensions.x-group-parameters}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index f6002e0ef9e7..e02068856b66 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -110,7 +110,7 @@ dependencies { implementation 'io.gsonfire:gson-fire:1.8.4' {{#openApiNullable}} implementation 'org.openapitools:jackson-databind-nullable:0.2.1' - {{/openApiNullable}} + {{/openApiNullable}} {{#hasOAuthMethods}} implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' {{/hasOAuthMethods}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/ApiClient.mustache index 1a691ea94821..2a0f41737c62 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/ApiClient.mustache @@ -19,7 +19,7 @@ import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jacks public class ApiClient { {{#basePath}} - public static final String BASE_URI = "{{basePath}}"; + public static final String BASE_URI = "{{.}}"; {{/basePath}} private final Config config; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/README.mustache index a0fac9d41dfc..c9877589b5ff 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/README.mustache @@ -40,4 +40,3 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache index dea1217125ed..8d4602511199 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache @@ -71,7 +71,7 @@ public class {{classname}} { @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", nickname = "{{{operationId}}}", - tags = { {{#tags}}{{#name}}"{{{name}}}"{{/name}}{{^-last}}, {{/-last}}{{/tags}} }) + tags = { {{#tags}}{{#name}}"{{{.}}}"{{/name}}{{^-last}}, {{/-last}}{{/tags}} }) @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}") {{^-last}},{{/-last}}{{/responses}} }) {{#isDeprecated}} @@ -103,7 +103,7 @@ public class {{classname}} { * @see #{{#isPathParam}}{{paramName}}Path{{/isPathParam}}{{#isQueryParam}}{{paramName}}Query{{/isQueryParam}}{{#isFormParam}}{{^isFile}}{{paramName}}Form{{/isFile}}{{#isFile}}{{paramName}}MultiPart{{/isFile}}{{/isFormParam}}{{#isHeaderParam}}{{paramName}}Header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} - * return {{returnType}} + * return {{.}} {{/returnType}} {{#isDeprecated}} * @deprecated diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_doc.mustache index f173a89016e1..c000bc962a15 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_doc.mustache @@ -1,22 +1,22 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{operationId}}** -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example ```java @@ -42,7 +42,7 @@ api.{{operationId}}(){{#allParams}}{{#required}}{{#isPathParam}} {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index 28c213b41b7f..4659399ee1d3 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -24,7 +24,7 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' - + android { compileSdkVersion 23 buildToolsVersion '23.0.2' @@ -36,7 +36,7 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } - + // Rename the aar correctly libraryVariants.all { variant -> variant.outputs.each { output -> @@ -52,7 +52,7 @@ if(hasProperty('target') && target == 'android') { provided 'javax.annotation:jsr250-api:1.0' } } - + afterEvaluate { android.libraryVariants.all { variant -> def task = project.tasks.create "jar${variant.name.capitalize()}", Jar @@ -64,12 +64,12 @@ if(hasProperty('target') && target == 'android') { artifacts.add('archives', task); } } - + task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } - + artifacts { archives sourcesJar } @@ -87,7 +87,7 @@ if(hasProperty('target') && target == 'android') { pom.artifactId = '{{artifactId}}' } } - + task execute(type:JavaExec) { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache index 775e0efea40f..79ebc96d3701 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache @@ -86,7 +86,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { this.json.setDateFormat((DateFormat) dateFormat.clone()); // Set default User-Agent. - setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache index 85891614c0ec..9194b7541a16 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache @@ -56,7 +56,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -75,7 +75,7 @@ public class {{classname}} { {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); {{#queryParams}} - localVarQueryParams.addAll(apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}}if ({{paramName}} != null) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index c4a9083f25c8..33c4d1ec9199 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -868,4 +868,3 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } } } - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache index 9c749da027a1..cc207bd1b564 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache @@ -54,13 +54,13 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#responses}} - *

{{code}}{{#message}} - {{message}}{{/message}} + *

{{code}}{{#message}} - {{.}}{{/message}} {{/responses}} {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} - * @return {{returnType}} + * @return {{.}} {{/returnType}} * @throws RestClientException if an error occurs while attempting to invoke the API {{#externalDocs}} @@ -74,7 +74,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { {{#returnType}} return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).getBody(); {{/returnType}} @@ -87,12 +87,12 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#responses}} - *

{{code}}{{#message}} - {{message}}{{/message}} + *

{{code}}{{#message}} - {{.}}{{/message}} {{/responses}} {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return ResponseEntity<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return ResponseEntity<{{returnType}}{{^returnType}}Void{{/returnType}}> * @throws RestClientException if an error occurs while attempting to invoke the API {{#externalDocs}} * {{description}} @@ -105,7 +105,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ResponseEntity<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { + public ResponseEntity<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -122,7 +122,7 @@ public class {{classname}} { final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap();{{#hasQueryParams}} - {{#queryParams}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{^-last}} + {{#queryParams}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{^-last}} {{/-last}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} {{#headerParams}}if ({{paramName}} != null) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache index 119194543c37..865572ae8cc1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache @@ -36,7 +36,7 @@ public class {{classname}}Test { {{#allParams}} {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache index 33331adb026f..dbfa4ae767bb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache @@ -4,18 +4,18 @@ import java.util.Arrays; import java.util.List; public class CollectionFormats { - + public static class CSVParams { protected List params; - + public CSVParams() { } - + public CSVParams(List params) { this.params = params; } - + public CSVParams(String... params) { this.params = Arrays.asList(params); } @@ -27,23 +27,23 @@ public class CollectionFormats { public void setParams(List params) { this.params = params; } - + @Override public String toString() { return StringUtil.join(params.toArray(new String[0]), ","); } - + } - + public static class SPACEParams extends SSVParams { } public static class SSVParams extends CSVParams { - + public SSVParams() { } - + public SSVParams(List params) { super(params); } @@ -57,16 +57,16 @@ public class CollectionFormats { return StringUtil.join(params.toArray(new String[0]), " "); } } - + public static class TSVParams extends CSVParams { - + public TSVParams() { } - + public TSVParams(List params) { super(params); } - + public TSVParams(String... params) { super(params); } @@ -76,16 +76,16 @@ public class CollectionFormats { return StringUtil.join( params.toArray(new String[0]), "\t"); } } - + public static class PIPESParams extends CSVParams { - + public PIPESParams() { } - + public PIPESParams(List params) { super(params); } - + public PIPESParams(String... params) { super(params); } @@ -95,5 +95,5 @@ public class CollectionFormats { return StringUtil.join(params.toArray(new String[0]), "|"); } } - + } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/README.mustache index a0fac9d41dfc..c9877589b5ff 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/README.mustache @@ -40,4 +40,3 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache index 041b6a8e9100..79e4ff1374bc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache @@ -26,7 +26,7 @@ public interface {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}} + * @return {{returnType}}{{^returnType}}Void{{/returnType}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation @@ -41,7 +41,7 @@ public interface {{classname}} { {{#formParams}}{{#-first}} {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} @{{httpMethod}}("{{{path}}}") - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}} {{operationId}}({{^allParams}});{{/allParams}} + {{{returnType}}}{{^returnType}}Void{{/returnType}} {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}{{^-last}}, {{/-last}}{{#-last}} );{{/-last}}{{/allParams}} @@ -67,7 +67,7 @@ public interface {{classname}} { {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} @{{httpMethod}}("{{{path}}}") void {{operationId}}( - {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}, {{/allParams}}Callback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> cb + {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}, {{/allParams}}Callback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> cb ); {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache index db07fb825c9a..112d7f73a807 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache @@ -36,7 +36,7 @@ public class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - // {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + // {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBasicAuth.mustache index 394592f64d9c..cf82b2775a7d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBasicAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBasicAuth.mustache @@ -11,7 +11,7 @@ public class HttpBasicAuth implements Interceptor { private String username; private String password; - + public String getUsername() { return username; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache index 4c39f4e629e5..57bfd3df238e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache @@ -66,7 +66,7 @@ public class OAuth implements Interceptor { break; default: break; - } + } } @Override @@ -93,7 +93,7 @@ public class OAuth implements Interceptor { if (getAccessToken() != null) { // Build the request Builder rb = request.newBuilder(); - + String requestAccessToken = new String(getAccessToken()); try { oAuthRequest = new OAuthBearerClientRequest(request.urlString()) @@ -102,15 +102,15 @@ public class OAuth implements Interceptor { } catch (OAuthSystemException e) { throw new IOException(e); } - + for ( Map.Entry header : oAuthRequest.getHeaders().entrySet() ) { rb.addHeader(header.getKey(), header.getValue()); } rb.url( oAuthRequest.getLocationUri()); - + //Execute the request Response response = chain.proceed(rb.build()); - + // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. if ( response != null && (response.code() == HTTP_UNAUTHORIZED || response.code() == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure ) { try { @@ -133,7 +133,7 @@ public class OAuth implements Interceptor { * Returns true if the access token has been updated */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { + if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { try { OAuthJSONAccessTokenResponse accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()); if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuthOkHttpClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuthOkHttpClient.mustache index ea195f7df04b..48fc7ea4c1fc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuthOkHttpClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuthOkHttpClient.mustache @@ -53,7 +53,7 @@ public class OAuthOkHttpClient implements HttpClient { try { Response response = client.newCall(requestBuilder.build()).execute(); return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), + response.body().string(), response.body().contentType().toString(), response.code(), responseClass); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache index de40d7275872..1196f2c13720 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache @@ -369,7 +369,7 @@ public class ApiClient { throw new RuntimeException("The ApiClient was created with a built OkHttpClient so it's not possible to add an authorization interceptor to it"); } okBuilder.addInterceptor(authorization); - + return this; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/README.mustache index 847b9d5a2a18..5e892a3fa506 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/README.mustache @@ -36,4 +36,3 @@ After the client library is installed/deployed, you can use it in your Maven pro {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache index baa89192cd78..dd199a5e108c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache @@ -47,7 +47,7 @@ public interface {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return {{^doNotUseRx}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} + * @return {{^doNotUseRx}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{#isDeprecated}} * @deprecated {{/isDeprecated}} @@ -74,7 +74,7 @@ public interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{{path}}}") - {{^doNotUseRx}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{operationId}}({{^allParams}});{{/allParams}} + {{^doNotUseRx}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}} );{{/-last}}{{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache index d214d97724cf..3f60dd13dfb5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache @@ -37,7 +37,7 @@ public class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - // {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + // {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/HttpBasicAuth.mustache index d45884266627..9bd756eb8563 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/HttpBasicAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/HttpBasicAuth.mustache @@ -12,7 +12,7 @@ public class HttpBasicAuth implements Interceptor { private String username; private String password; - + public String getUsername() { return username; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuth.mustache index 80ec7b3946cb..88e4e62bf858 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuth.mustache @@ -66,7 +66,7 @@ public class OAuth implements Interceptor { break; default: break; - } + } } @Override @@ -133,7 +133,7 @@ public class OAuth implements Interceptor { * Returns true if the access token has been updated */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { + if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { try { OAuthJSONAccessTokenResponse accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()); if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuthOkHttpClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuthOkHttpClient.mustache index 423fa1ba0e52..a499c7b8ba08 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuthOkHttpClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuthOkHttpClient.mustache @@ -56,7 +56,7 @@ public class OAuthOkHttpClient implements HttpClient { try { Response response = client.newCall(requestBuilder.build()).execute(); return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), + response.body().string(), response.body().contentType().toString(), response.code(), responseClass); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache index be7cac4a0d5e..d9ed3330fbd0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache @@ -48,7 +48,7 @@ public class Play24CallAdapterFactory extends CallAdapter.Factory { return new ValueAdapter(resultType, includeResponse); } - + /** * Adapter that coverts values returned by API interface into CompletionStage */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache index 088f24946508..2b7512d192da 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache @@ -33,7 +33,7 @@ public interface {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return Call<{{returnType}}{{^returnType}}Void{{/returnType}}> {{#isDeprecated}} * @deprecated {{/isDeprecated}} @@ -56,7 +56,7 @@ public interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{{path}}}") - F.Promise> {{operationId}}({{^allParams}});{{/allParams}} + F.Promise> {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}} );{{/-last}}{{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache index 088c10b160ac..62360bf984c4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache @@ -114,4 +114,3 @@ public class Play25CallAdapterFactory extends CallAdapter.Factory { } } } - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache index dd59ee37ea29..d4e97cc347b6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache @@ -33,7 +33,7 @@ public interface {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return Call<{{returnType}}{{^returnType}}Void{{/returnType}}> {{#isDeprecated}} * @deprecated {{/isDeprecated}} @@ -56,7 +56,7 @@ public interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{{path}}}") - CompletionStage> {{operationId}}({{^allParams}});{{/allParams}} + CompletionStage> {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}} );{{/-last}}{{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache index dd59ee37ea29..d4e97cc347b6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache @@ -33,7 +33,7 @@ public interface {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return Call<{{returnType}}{{^returnType}}Void{{/returnType}}> {{#isDeprecated}} * @deprecated {{/isDeprecated}} @@ -56,7 +56,7 @@ public interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{{path}}}") - CompletionStage> {{operationId}}({{^allParams}});{{/allParams}} + CompletionStage> {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}} );{{/-last}}{{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache index 95951e3c06af..b3668e995ade 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache @@ -656,7 +656,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { protected WebClient buildWebClient(Vertx vertx, JsonObject config) { if (!config.containsKey("userAgent")) { - config.put("userAgent", "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + config.put("userAgent", "{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); } return WebClient.create(vertx, new WebClientOptions(config)); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api.mustache index 1f20fa386d3c..b81c06100659 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api.mustache @@ -16,12 +16,12 @@ public interface {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> handler); + void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> handler); {{#isDeprecated}} @Deprecated {{/isDeprecated}} - void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> handler); + void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> handler); {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache index e9e9a2fe7de2..35daaade98f2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache @@ -51,7 +51,7 @@ public class {{classname}}Impl implements {{classname}} { {{/allParams}} * @param resultHandler Asynchronous result handler */ - public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> resultHandler) { + public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> resultHandler) { {{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}null, resultHandler); } @@ -64,7 +64,7 @@ public class {{classname}}Impl implements {{classname}} { * @param authInfo per call authentication override. * @param resultHandler Asynchronous result handler */ - public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> resultHandler) { + public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -79,7 +79,7 @@ public class {{classname}}Impl implements {{classname}} { // query params List localVarQueryParams = new ArrayList<>(); {{#queryParams}} - localVarQueryParams.addAll(apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} // header params diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache index 40968fa3cc16..5432485d9dfe 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache @@ -223,7 +223,7 @@ jsr305 3.0.2 - + io.vertx diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache index f1f5d0323f51..f01030420284 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache @@ -33,7 +33,7 @@ public class {{classname}} { {{/allParams}} * @param resultHandler Asynchronous result handler */ - public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> resultHandler) { + public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> resultHandler) { delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}resultHandler); } @@ -46,7 +46,7 @@ public class {{classname}} { * @param authInfo call specific auth overrides * @param resultHandler Asynchronous result handler */ - public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> resultHandler) { + public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> resultHandler) { delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}authInfo, resultHandler); } @@ -58,7 +58,7 @@ public class {{classname}} { {{/allParams}} * @return Asynchronous result handler (RxJava Single) */ - public Single<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> rx{{operationIdCamelCase}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { + public Single<{{{returnType}}}{{^returnType}}Void{{/returnType}}> rx{{operationIdCamelCase}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}fut) )); @@ -73,7 +73,7 @@ public class {{classname}} { * @param authInfo call specific auth overrides * @return Asynchronous result handler (RxJava Single) */ - public Single<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> rx{{operationIdCamelCase}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo) { + public Single<{{{returnType}}}{{^returnType}}Void{{/returnType}}> rx{{operationIdCamelCase}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}authInfo, fut) )); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache index 2f79b9293156..166a4fbcd29e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache @@ -54,9 +54,9 @@ public class {{classname}} { /** * {{summary}} * {{notes}} -{{#responses}} *

{{code}}{{#message}} - {{message}}{{/message}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} {{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} -{{/allParams}}{{#returnType}} * @return {{returnType}} +{{/allParams}}{{#returnType}} * @return {{.}} {{/returnType}} * @throws WebClientResponseException if an error occurs while attempting to invoke the API {{#externalDocs}} * {{description}} @@ -95,7 +95,7 @@ public class {{classname}} { {{#hasQueryParams}} {{#queryParams}} - queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); {{/queryParams}} {{/hasQueryParams}} {{#hasHeaderParams}} @@ -109,7 +109,7 @@ public class {{classname}} { {{#hasCookieParams}} {{#cookieParams}} - cookieParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + cookieParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); {{/cookieParams}} {{/hasCookieParams}} {{#hasFormParams}} @@ -138,9 +138,9 @@ public class {{classname}} { /** * {{summary}} * {{notes}} -{{#responses}} *

{{code}}{{#message}} - {{message}}{{/message}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} {{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} -{{/allParams}}{{#returnType}} * @return {{returnType}} +{{/allParams}}{{#returnType}} * @return {{.}} {{/returnType}} * @throws WebClientResponseException if an error occurs while attempting to invoke the API {{#externalDocs}} * {{description}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache index a4757694c5b9..b9aea5320fa6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache @@ -34,7 +34,7 @@ public class {{classname}}Test { {{#allParams}} {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#isArray}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}.block(){{/isArray}}{{^isArray}}.block(){{/isArray}}; + {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#isArray}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}.block(){{/isArray}}{{^isArray}}.block(){{/isArray}}; // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache index c335e7ad4419..9d352d127f9a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache @@ -105,7 +105,7 @@ if(hasProperty('target') && target == 'android') { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } - + task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource @@ -162,4 +162,3 @@ dependencies { implementation "javax.annotation:javax.annotation-api:$javax_annotation_version" testImplementation "junit:junit:$junit_version" } - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache index 67a888863b49..0b24d140966c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache @@ -71,7 +71,7 @@ swagger-annotations ${swagger-annotations-version} - + com.google.code.findbugs diff --git a/modules/openapi-generator/src/main/resources/Java/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Java/licenseInfo.mustache index abc2f4578eb3..c66209f27947 100644 --- a/modules/openapi-generator/src/main/resources/Java/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/Java/modelEnum.mustache b/modules/openapi-generator/src/main/resources/Java/modelEnum.mustache index 207a937ebdea..f81c7c93ff13 100644 --- a/modules/openapi-generator/src/main/resources/Java/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/Java/modelEnum.mustache @@ -11,20 +11,20 @@ import com.google.gson.stream.JsonWriter; {{/gson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ {{#gson}} -@JsonAdapter({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class) +@JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class) {{/gson}} {{#jsonb}} @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) {{/jsonb}} -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} {{#withXml}} @@ -35,7 +35,7 @@ import com.google.gson.stream.JsonWriter; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -54,8 +54,8 @@ import com.google.gson.stream.JsonWriter; {{#jackson}} @JsonCreator {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } @@ -64,16 +64,16 @@ import com.google.gson.stream.JsonWriter; } {{#gson}} - public static class Adapter extends TypeAdapter<{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { @Override - public void write(final JsonWriter jsonWriter, final {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}next{{{dataType}}}(){{/isInteger}}{{/isNumber}}; - return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); } } {{/gson}} @@ -81,7 +81,7 @@ import com.google.gson.stream.JsonWriter; public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { @Override public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(parser.getString())) { return b; } diff --git a/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache index e0a194d6ba6f..a9c99783fd0f 100644 --- a/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache +++ b/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache @@ -1,8 +1,8 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ {{#gson}} - @JsonAdapter({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.Adapter.class) + @JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.Adapter.class) {{/gson}} {{#jsonb}} @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) @@ -12,12 +12,12 @@ @XmlType(name="{{datatypeWithEnum}}") @XmlEnum({{dataType}}.class) {{/withXml}} - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} {{#withXml}} @@ -30,7 +30,7 @@ private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -49,8 +49,8 @@ {{#jackson}} @JsonCreator {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } @@ -59,16 +59,16 @@ } {{#gson}} - public static class Adapter extends TypeAdapter<{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { @Override - public void write(final JsonWriter jsonWriter, final {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isInteger}}{{/isNumber}}; - return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); } } {{/gson}} @@ -76,7 +76,7 @@ public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { @Override public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(parser.getString())) { return b; } diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index 77d080ccba32..b9be16ad5655 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -1,9 +1,9 @@ /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} @Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{description}}}"){{/description}} +@ApiModel(description = "{{{.}}}"){{/description}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} @@ -13,7 +13,7 @@ @JsonTypeName("{{name}}") {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} -public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -37,21 +37,21 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/jackson}} {{#withXml}} {{#isXmlAttribute}} - @XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isXmlAttribute}} {{^isXmlAttribute}} {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isContainer}} {{#isContainer}} // Is a container wrapped={{isXmlWrapped}} {{#items}} // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/items}} {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isXmlWrapped}} {{/isContainer}} {{/isXmlAttribute}} @@ -160,16 +160,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/isReadOnly}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} {{#deprecated}} @@ -193,7 +193,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{#jsonb}} @JsonbProperty("{{baseName}}") {{/jsonb}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} diff --git a/modules/openapi-generator/src/main/resources/Java/pojo_doc.mustache b/modules/openapi-generator/src/main/resources/Java/pojo_doc.mustache index f56437544658..247aaf68617d 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo_doc.mustache @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}**{{baseType}}{{#items}}<{{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}**Map<String, {{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}**{{dataType}}**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} +{{#vars}}**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}**{{baseType}}{{#items}}<{{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}**Map<String, {{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}**{{dataType}}**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} {{/vars}} {{#vars}}{{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/Java/xmlAnnotation.mustache b/modules/openapi-generator/src/main/resources/Java/xmlAnnotation.mustache index 04566fa1167c..4f3b448c8d1c 100644 --- a/modules/openapi-generator/src/main/resources/Java/xmlAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/Java/xmlAnnotation.mustache @@ -1,6 +1,6 @@ {{#withXml}} -@XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") +@XmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") @XmlAccessorType(XmlAccessType.FIELD) {{#jackson}} -@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}"){{/jackson}}{{/withXml}} \ No newline at end of file +@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}"){{/jackson}}{{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/README.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/README.mustache index c1309670c5ad..924e49fe194d 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/README.mustache @@ -5,4 +5,3 @@ Run with ``` mvn package jetty:run `` - diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/api.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/api.mustache index 71056d37509a..f980a89d754a 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/api.mustache @@ -16,7 +16,7 @@ import {{modelPackage}}.*; {{>generatedAnnotation}} {{#operations}} public class {{classname}} { - /** + /** * Uncomment and implement as you see fit. These operations will map * Directly to operation calls from the routing logic. Because the inflector * Code allows you to implement logic incrementally, they are disabled. @@ -32,4 +32,3 @@ public class {{classname}} { {{/operation}} } {{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/enumClass.mustache index 49f3cb7922bc..27e8d1254fed 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/enumClass.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}} {{#enumVars}} @@ -22,7 +22,7 @@ private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -33,8 +33,8 @@ } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(text)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/enumOuterClass.mustache index 123ccb2ca6a2..2832cfa53936 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/enumOuterClass.mustache @@ -3,9 +3,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -31,8 +31,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(text)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/model.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/model.mustache index b9512d2b83cb..d2edbebd5b4b 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/model.mustache @@ -8,7 +8,7 @@ import java.util.Objects; {{#models}} {{#model}}{{#description}} /** - * {{description}} + * {{.}} **/{{/description}} {{#isEnum}}{{>enumOuterClass}}{{/isEnum}} {{^isEnum}}{{>pojo}}{{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache index 2a13cf41e796..3de4a0d8c310 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache @@ -1,6 +1,6 @@ -{{#description}}@ApiModel(description = "{{{description}}}"){{/description}} +{{#description}}@ApiModel(description = "{{{.}}}"){{/description}} {{>generatedAnnotation}}{{>additionalModelTypeAnnotations}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}} {{#isEnum}} {{^isContainer}} @@ -28,9 +28,9 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} {{#vars}} /**{{#description}} - * {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} + * {{{.}}}{{/description}}{{#minimum}} + * minimum: {{.}}{{/minimum}}{{#maximum}} + * maximum: {{.}}{{/maximum}} **/ public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; @@ -38,7 +38,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali } {{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") @JsonProperty("{{baseName}}") public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/allowableValues.mustache index a48256d027a1..75bce9385dea 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{min}}{{^min}}-infinity{{/min}}, {{max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache index 9eb362285cb2..b61de13287be 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache @@ -49,7 +49,7 @@ public class {{classname}} { } catch (Exception e) { throw new RuntimeException(e); } - } + } } if (delegate == null) { @@ -64,7 +64,7 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} @@ -73,7 +73,7 @@ public class {{classname}} { }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}} + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}} {{/responses}} }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},{{/allParams}}@Context SecurityContext securityContext) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/beanValidationCore.mustache index 1f9f43e7b868..ff4ffe26c497 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/beanValidationCore.mustache @@ -4,17 +4,17 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/bodyParams.mustache index a7351b38ac5b..7e97a6a42594 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/bodyParams.mustache @@ -3,7 +3,7 @@ }}@ApiParam(value = "{{{description}}}"{{! }}{{#required}}, required = true{{/required}}{{! }}{{#allowableValues}}, {{> allowableValues}}{{/allowableValues}}{{! - }}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}{{! + }}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{! }}){{! }}{{#useBeanValidation}} {{>beanValidation}}{{/useBeanValidation}}{{! diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/allowableValues.mustache index a48256d027a1..75bce9385dea 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{min}}{{^min}}-infinity{{/min}}, {{max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache index f48acfd1dcd5..a3c9c9721ee6 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache @@ -44,14 +44,14 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} - @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}{{#isOAuth}}@Authorization(value = "{{name}}", scopes = { {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}} {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) { return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{paramName}}InputStream, {{paramName}}Detail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext); } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationCore.mustache index 1f9f43e7b868..ff4ffe26c497 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationCore.mustache @@ -4,17 +4,17 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/bodyParams.mustache index 2b28441d3d05..dd3506d206d3 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache index 829a9f6e314f..046f2785fd41 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache @@ -1,6 +1,6 @@ @XmlType(name="{{datatypeWithEnum}}") @XmlEnum({{dataType}}.class) -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}}@XmlEnumValue({{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} @@ -9,7 +9,7 @@ private {{dataType}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{dataType}} v) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{dataType}} v) { value = v; } @@ -22,8 +22,8 @@ return String.valueOf(value); } - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{dataType}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{dataType}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/headerParams.mustache index 200a109ca645..00cd70487be8 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache index df7d1df8d210..96d4ac3277c8 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache @@ -11,7 +11,7 @@ import javax.validation.constraints.*; {{#models}} {{#model}}{{#description}} /** - * {{description}} + * {{.}} **/{{/description}} {{#isEnum}}{{>enumOuterClass}}{{/isEnum}} {{^isEnum}}{{>pojo}}{{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache index 4e21dd6091ed..d8ab20f4655f 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}) @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache index 1f93ba848d30..5a9867bad2b0 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache @@ -3,8 +3,8 @@ import java.util.Objects; import javax.xml.bind.annotation.*; -{{#description}}@ApiModel(description = "{{{description}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +{{#description}}@ApiModel(description = "{{{.}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} @@ -20,13 +20,13 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} **/ public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { @@ -35,7 +35,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali } {{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") @JsonProperty("{{baseName}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache index 1f2caa5a5f4c..2066179d96ed 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache @@ -76,14 +76,14 @@ swagger-annotations [1.5.3,1.5.16] - + com.google.code.findbugs jsr305 3.0.2 - + {{#useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache index e132b51a7563..b7addff1a932 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{^isContainer}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{defaultValue}}}") {{/defaultValue}}{{/isContainer}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{^isContainer}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{.}}}") {{/defaultValue}}{{/isContainer}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/allowableValues.mustache index a48256d027a1..75bce9385dea 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{min}}{{^min}}-infinity{{/min}}, {{max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api.mustache index a38ba492662f..8c517fd6dd57 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api.mustache @@ -27,7 +27,7 @@ import javax.validation.Valid; * {{{appName}}} * {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} * {{/appDescription}} */ @@ -47,7 +47,7 @@ public interface {{classname}} { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} */ @@ -62,9 +62,8 @@ public interface {{classname}} { {{/hasProduces}} @ApiOperation(value = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/responses}} }) + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/responses}} }) public {{>returnTypes}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} } {{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/apiServiceImpl.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/apiServiceImpl.mustache index 633f014cf44d..d93ffe8166b7 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/apiServiceImpl.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/apiServiceImpl.mustache @@ -39,7 +39,7 @@ import org.springframework.stereotype.Service; * {{{appName}}} * {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} {{/appDescription}} * */ @@ -68,7 +68,7 @@ public class {{classname}}ServiceImpl implements {{classname}} { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} */ diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache index 6b141183c24d..7df1a6c2ee57 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache @@ -61,11 +61,11 @@ import org.openapitools.codegen.utils.JsonCache; /** {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} * {{/appDescription}} * API tests for {{classname}}. @@ -96,7 +96,7 @@ public class {{classname}}Test { {{#generateSpringBootApplication}} @LocalServerPort private int serverPort; -{{/generateSpringBootApplication}} +{{/generateSpringBootApplication}} private {{classname}} api; @@ -104,23 +104,23 @@ public class {{classname}}Test { public void setup() { List providers = Arrays.asList(new JacksonJsonProvider(), new JacksonXMLProvider(), new MultipartProvider()); -{{#generateSpringBootApplication}} +{{#generateSpringBootApplication}} api = JAXRSClientFactory.create("http://localhost:" + serverPort + "/services", {{classname}}.class, providers); -{{/generateSpringBootApplication}} +{{/generateSpringBootApplication}} {{^generateSpringBootApplication}} api = JAXRSClientFactory.create("{{{basePath}}}", {{classname}}.class, providers); {{/generateSpringBootApplication}} org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); - ClientConfiguration config = WebClient.getConfig(client); -{{#useGzipFeatureForTests}} + ClientConfiguration config = WebClient.getConfig(client); +{{#useGzipFeatureForTests}} // Example for using Gzipping GZIPOutInterceptor gzipOutInterceptor = new GZIPOutInterceptor(); // use Gzipping for first request sent to server //gzipOutInterceptor.setForce(true); config.getOutInterceptors().add(gzipOutInterceptor); - config.getInInterceptors().add(new GZIPInInterceptor()); + config.getInInterceptors().add(new GZIPInInterceptor()); {{/useGzipFeatureForTests}} {{#useLoggingFeatureForTests}} LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor(); @@ -147,7 +147,7 @@ public class {{classname}}Test { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} {{/summary}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationCore.mustache index e1c2d841e0a1..252828809b3a 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationCore.mustache @@ -4,17 +4,17 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! -}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{.}}"){{/minimum}}{{#maximum}} @DecimalMax("{{.}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationHeaderParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationHeaderParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationHeaderParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationQueryParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumClass.mustache index ea397c86bbf2..a27b23ef7538 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumClass.mustache @@ -3,7 +3,7 @@ {{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}} { {{#allowableValues}} - {{#enumVars}}@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @JsonProperty({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, + {{#enumVars}}@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @JsonProperty({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/allowableValues}} @@ -23,7 +23,7 @@ } public static {{datatypeWithEnum}} fromValue({{dataType}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumOuterClass.mustache index 8d5639a8dec3..149cb8a99531 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumOuterClass.mustache @@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,14 +21,14 @@ import com.fasterxml.jackson.annotation.JsonValue; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @Override {{#jackson}} @JsonValue -{{/jackson}} +{{/jackson}} public String toString() { return String.valueOf(value); } @@ -36,13 +36,13 @@ import com.fasterxml.jackson.annotation.JsonValue; {{#jackson}} @JsonCreator {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } } {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} } - + } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/licenseInfo.mustache index 9866f297a4d7..be193d0c4fe8 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache index b5546d95a402..c8fb8fb44d20 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache @@ -23,19 +23,19 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @ApiModel(description="{{{description}}}") {{/description}}{{>additionalModelTypeAnnotations}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} {{#description}} /** - * {{{description}}} + * {{{.}}} */ {{/description}} {{#withXml}} @XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}}) {{/withXml}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}{{#useBeanValidation}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{/isFile}}{{/isString}}{{/isDateTime}}{{/isDate}}{{/isPrimitiveType}} {{#isDate}} @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") @@ -53,16 +53,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializ {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} */ diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache index e9df52a01a6d..3942068dc5fe 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache @@ -5,7 +5,7 @@ jar {{artifactId}} {{#appDescription}} - {{appDescription}} + {{.}} {{/appDescription}} {{artifactVersion}} @@ -131,7 +131,7 @@ ${cxf-version} test - + org.apache.cxf @@ -183,13 +183,13 @@ ${jackson-jaxrs-version} {{/java8}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} org.hibernate hibernate-validator 5.2.2.Final -{{/useBeanValidationFeature}} +{{/useBeanValidationFeature}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/queryParams.mustache index f89529fdb5dd..38bfb9ed06e7 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{defaultValue}}}") {{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{.}}}") {{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/returnTypes.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/returnTypes.mustache index 6af86ffe4e4a..32f96a904720 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/returnTypes.mustache @@ -1,4 +1,4 @@ -{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: +{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: }}{{^useGenericResponse}}{{! }}{{{returnType}}}{{! }}{{/useGenericResponse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/ApplicationContext.xml.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/ApplicationContext.xml.mustache index b911475e293a..e85294fb336d 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/ApplicationContext.xml.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/ApplicationContext.xml.mustache @@ -1,6 +1,6 @@ - {{! http://cxf.apache.org/docs/swagger2feature.html }} + {{! http://cxf.apache.org/docs/swagger2feature.html }} {{#useSwaggerUI}} @@ -54,7 +54,7 @@ {{#useGzipFeature}} {{/useGzipFeature}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} {{/useBeanValidationFeature}} @@ -81,14 +81,14 @@ -{{#useWadlFeature}} +{{#useWadlFeature}} {{/useWadlFeature}} -{{#useGzipFeature}} +{{#useGzipFeature}} @@ -136,10 +136,10 @@ {{/useWadlFeature}} -{{#useSwaggerFeature}} +{{#useSwaggerFeature}} {{/useSwaggerFeature}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} {{/useBeanValidationFeature}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/SpringBootApplication.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/SpringBootApplication.mustache index a65a60f3ec21..a2c2d9c645d0 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/SpringBootApplication.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/SpringBootApplication.mustache @@ -11,15 +11,15 @@ import org.springframework.context.annotation.ImportResource; @EnableAutoConfiguration @SpringBootConfiguration public class SpringBootApplication extends SpringBootServletInitializer { - + @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(SpringBootApplication.class); } - + public static void main(String[] args) { SpringApplication.run(SpringBootApplication.class, args); } - - + + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/context.xml.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/context.xml.mustache index a14b9a13d015..0dc82b9a2e95 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/context.xml.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/context.xml.mustache @@ -1,6 +1,6 @@ - - + + - + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache index 8cb82501d51f..be1e78234c42 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache @@ -5,7 +5,7 @@ war {{artifactId}} {{#appDescription}} - {{appDescription}} + {{.}} {{/appDescription}} {{artifactVersion}} {{#generateSpringBootApplication}} @@ -96,7 +96,7 @@ - + maven-war-plugin @@ -227,7 +227,7 @@ {{/generateSpringBootApplication}} {{/java8}} -{{#generateSpringApplication}} +{{#generateSpringApplication}} org.springframework @@ -256,7 +256,7 @@ {{^generateSpringBootApplication}} ${spring-version} {{/generateSpringBootApplication}} - + {{/generateSpringApplication}} {{#generateSpringBootApplication}} @@ -331,11 +331,11 @@ {{#useBeanValidation}} 1.1.0.Final {{/useBeanValidation}} -{{#generateSpringApplication}} +{{#generateSpringApplication}} {{^generateSpringBootApplication}} 5.0.8.RELEASE {{/generateSpringBootApplication}} -{{/generateSpringApplication}} +{{/generateSpringApplication}} {{^generateSpringBootApplication}} 4.13 1.2.0 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/web.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/web.mustache index 9d905ae076bb..890f10ef14d8 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/web.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/web.mustache @@ -19,5 +19,5 @@ CXFServiceServlet /rest/* - + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/allowableValues.mustache index a48256d027a1..75bce9385dea 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{min}}{{^min}}-infinity{{/min}}, {{max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api.mustache index 6b8e85e9239b..09f19bbe5dd0 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api.mustache @@ -27,7 +27,7 @@ import javax.validation.Valid; * {{{appName}}} * {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} * {{/appDescription}} */ @@ -47,7 +47,7 @@ public interface {{classname}} { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} */ @@ -62,9 +62,8 @@ public interface {{classname}} { {{/hasProduces}} @ApiOperation(value = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/responses}} }) + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/responses}} }) public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} } {{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache index 52aa0e90ef7b..bb9bc8d55fa9 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache @@ -30,7 +30,7 @@ import org.springframework.stereotype.Service; * {{{appName}}} * {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} {{/appDescription}} * */ @@ -43,18 +43,17 @@ public class {{classname}}ServiceImpl implements {{classname}} { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} */ {{/summary}} public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{^-last}}, {{/-last}}{{/allParams}}) { // TODO: Implement... - + {{#useGenericResponse}}return Response.ok().entity("magic!").build();{{/useGenericResponse}}{{^useGenericResponse}}{{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}}{{/useGenericResponse}} } - + {{/operation}} } {{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api_test.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api_test.mustache index 063c65543002..43c1d40d7a1c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api_test.mustache @@ -43,14 +43,14 @@ import org.springframework.test.context.web.WebAppConfiguration; /** {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} * {{/appDescription}} - * API tests for {{classname}} + * API tests for {{classname}} */ {{#generateSpringBootApplication}} @RunWith(SpringJUnit4ClassRunner.class) @@ -63,33 +63,33 @@ public class {{classname}}Test { {{#generateSpringBootApplication}} @Value("${local.server.port}") private int serverPort; -{{/generateSpringBootApplication}} +{{/generateSpringBootApplication}} private {{classname}} api; - + @Before public void setup() { JacksonJsonProvider provider = new JacksonJsonProvider(); List providers = new ArrayList(); providers.add(provider); - -{{#generateSpringBootApplication}} + +{{#generateSpringBootApplication}} api = JAXRSClientFactory.create("http://localhost:" + serverPort + "/services", {{classname}}.class, providers); -{{/generateSpringBootApplication}} +{{/generateSpringBootApplication}} {{^generateSpringBootApplication}} api = JAXRSClientFactory.create("{{{basePath}}}", {{classname}}.class, providers); {{/generateSpringBootApplication}} org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); - - ClientConfiguration config = WebClient.getConfig(client); -{{#useGzipFeatureForTests}} + + ClientConfiguration config = WebClient.getConfig(client); +{{#useGzipFeatureForTests}} // Example for using Gzipping GZIPOutInterceptor gzipOutInterceptor = new GZIPOutInterceptor(); // use Gzipping for first request sent to server //gzipOutInterceptor.setForce(true); config.getOutInterceptors().add(gzipOutInterceptor); - - config.getInInterceptors().add(new GZIPInInterceptor()); + + config.getInInterceptors().add(new GZIPInInterceptor()); {{/useGzipFeatureForTests}} {{#useLoggingFeatureForTests}} LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor(); @@ -103,7 +103,7 @@ public class {{classname}}Test { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} {{/summary}} @@ -118,8 +118,8 @@ public class {{classname}}Test { //{{^vendorExtensions.x-java-is-response-void}}{{>returnTypes}} response = {{/vendorExtensions.x-java-is-response-void}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{^vendorExtensions.x-java-is-response-void}}//assertNotNull(response);{{/vendorExtensions.x-java-is-response-void}} // TODO: test validations - - + + } {{/operation}}{{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache index 1f9f43e7b868..ff4ffe26c497 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache @@ -4,17 +4,17 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationHeaderParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationHeaderParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationHeaderParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumClass.mustache index f2944aa59137..fa2e6804f317 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumClass.mustache @@ -29,7 +29,7 @@ @JsonCreator {{/jackson}} public static {{datatypeWithEnum}} fromValue({{dataType}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache index 8d5639a8dec3..149cb8a99531 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache @@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,14 +21,14 @@ import com.fasterxml.jackson.annotation.JsonValue; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @Override {{#jackson}} @JsonValue -{{/jackson}} +{{/jackson}} public String toString() { return String.valueOf(value); } @@ -36,13 +36,13 @@ import com.fasterxml.jackson.annotation.JsonValue; {{#jackson}} @JsonCreator {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } } {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} } - + } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/licenseInfo.mustache index 9866f297a4d7..be193d0c4fe8 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache index 0dd381f8ee4b..23fc0fb38ac0 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache @@ -14,18 +14,18 @@ import com.fasterxml.jackson.annotation.JsonProperty; **/ @ApiModel(description="{{{description}}}") {{/description}} -{{>additionalModelTypeAnnotations}}{{>xmlPojoAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { +{{>additionalModelTypeAnnotations}}{{>xmlPojoAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} {{#withXml}} @XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}}) {{/withXml}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}{{#useBeanValidation}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{/isFile}}{{/isString}}{{/isDateTime}}{{/isDate}}{{/isPrimitiveType}} {{#description}} /** - * {{{description}}} + * {{{.}}} **/ {{/description}} {{#vendorExtensions.x-is-jackson-optional-nullable}} @@ -48,16 +48,16 @@ import com.fasterxml.jackson.annotation.JsonProperty; {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} **/ diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache index 493fd683cf94..653db6baad67 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache @@ -5,7 +5,7 @@ jar {{artifactId}} {{#appDescription}} - {{appDescription}} + {{.}} {{/appDescription}} {{artifactVersion}} @@ -131,7 +131,7 @@ ${cxf-version} test - + org.apache.cxf @@ -177,7 +177,7 @@ ${jackson-jaxrs-version} {{/java8}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} org.hibernate hibernate-validator diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/queryParams.mustache index 292a818f8f17..6a1045abc508 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{defaultValue}}}"){{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache index 6af86ffe4e4a..32f96a904720 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache @@ -1,4 +1,4 @@ -{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: +{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: }}{{^useGenericResponse}}{{! }}{{{returnType}}}{{! }}{{/useGenericResponse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/ApplicationContext.xml.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/ApplicationContext.xml.mustache index b4cdc5b6cfdf..fea1aecd1747 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/ApplicationContext.xml.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/ApplicationContext.xml.mustache @@ -1,6 +1,6 @@ - -{{#useMultipartFeature}} + +{{#useMultipartFeature}} -{{/useMultipartFeature}} - +{{/useMultipartFeature}} + -{{#useSpringAnnotationConfig}} +{{#useSpringAnnotationConfig}} {{/useSpringAnnotationConfig}} -{{^useSpringAnnotationConfig}} +{{^useSpringAnnotationConfig}} {{#apiInfo}} {{#apis}} @@ -33,71 +33,71 @@ {{/apiInfo}} {{/useSpringAnnotationConfig}} -{{#useSwaggerFeature}} +{{#useSwaggerFeature}} - {{! http://cxf.apache.org/docs/swagger2feature.html }} + {{! http://cxf.apache.org/docs/swagger2feature.html }} -{{#useSwaggerUI}} +{{#useSwaggerUI}} -{{/useSwaggerUI}} +{{/useSwaggerUI}} - + {{/useSwaggerFeature}} -{{#useGzipFeature}} +{{#useGzipFeature}} {{/useGzipFeature}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} -{{/useBeanValidationFeature}} +{{/useBeanValidationFeature}} -{{#useGzipFeature}} +{{#useGzipFeature}} -{{/useGzipFeature}} +{{/useGzipFeature}} {{#useBeanValidationFeature}} -{{/useBeanValidationFeature}} +{{/useBeanValidationFeature}} -{{#useLoggingFeature}} +{{#useLoggingFeature}} -{{/useLoggingFeature}} -{{#useGzipFeature}} +{{/useLoggingFeature}} +{{#useGzipFeature}} -{{/useGzipFeature}} +{{/useGzipFeature}} - -{{#useWadlFeature}} + +{{#useWadlFeature}} {{/useWadlFeature}} -{{#useGzipFeature}} +{{#useGzipFeature}} - + -{{/useGzipFeature}} +{{/useGzipFeature}} {{#useBeanValidationFeature}} @@ -107,17 +107,17 @@ - + - + {{/useBeanValidationFeature}} {{^useBeanValidationFeature}} {{/useBeanValidationFeature}} - + @@ -129,21 +129,21 @@ -{{#useMultipartFeature}} +{{#useMultipartFeature}} -{{/useMultipartFeature}} -{{#useWadlFeature}} +{{/useMultipartFeature}} +{{#useWadlFeature}} -{{/useWadlFeature}} +{{/useWadlFeature}} -{{#useSwaggerFeature}} +{{#useSwaggerFeature}} -{{/useSwaggerFeature}} -{{#useBeanValidationFeature}} +{{/useSwaggerFeature}} +{{#useBeanValidationFeature}} -{{/useBeanValidationFeature}} +{{/useBeanValidationFeature}} - + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/SpringBootApplication.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/SpringBootApplication.mustache index f6d08e712964..b71ad21f3ee4 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/SpringBootApplication.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/SpringBootApplication.mustache @@ -9,15 +9,15 @@ import org.springframework.context.annotation.ImportResource; @ImportResource({"classpath:/ApplicationContext.xml"}) @EnableAutoConfiguration public class SpringBootApplication extends SpringBootServletInitializer { - + @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(SpringBootApplication.class); } - + public static void main(String[] args) { SpringApplication.run(SpringBootApplication.class, args); } - - + + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/context.xml.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/context.xml.mustache index a14b9a13d015..0dc82b9a2e95 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/context.xml.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/context.xml.mustache @@ -1,6 +1,6 @@ - - + + - + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index 28a678bb6128..edd5bef28938 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -5,7 +5,7 @@ war {{artifactId}} {{#appDescription}} - {{appDescription}} + {{.}} {{/appDescription}} {{artifactVersion}} @@ -88,7 +88,7 @@ - + maven-war-plugin @@ -140,7 +140,7 @@ ${cxf-version} test - + org.apache.cxf @@ -192,7 +192,7 @@ ${jackson-jaxrs-version} {{/java8}} -{{#generateSpringApplication}} +{{#generateSpringApplication}} org.springframework @@ -203,7 +203,7 @@ org.springframework spring-web ${spring-version} - + {{/generateSpringApplication}} {{#generateSpringBootApplication}} @@ -220,7 +220,7 @@ ${spring.boot-version} test - + org.apache.cxf cxf-spring-boot-starter-jaxrs @@ -263,12 +263,12 @@ {{#useBeanValidation}} 1.1.0.Final {{/useBeanValidation}} -{{#generateSpringApplication}} +{{#generateSpringApplication}} 4.3.13.RELEASE -{{/generateSpringApplication}} +{{/generateSpringApplication}} {{#generateSpringBootApplication}} 1.5.9.RELEASE -{{/generateSpringBootApplication}} +{{/generateSpringBootApplication}} 3.3.0 2.9.9 1.3.2 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/web.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/web.mustache index 9d905ae076bb..890f10ef14d8 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/web.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/web.mustache @@ -19,5 +19,5 @@ CXFServiceServlet /rest/* - + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/enumClass.mustache index 579070d66e6b..d5394d737de3 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/enumClass.mustache @@ -1,13 +1,13 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}} {{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,7 +21,7 @@ {{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} {{{name}}}({{{value}}}){{^-last}}, @@ -32,7 +32,7 @@ private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -43,8 +43,8 @@ } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/enumOuterClass.mustache index 84e034d1cf3b..f41a3eb84556 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/enumOuterClass.mustache @@ -3,14 +3,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{#allowableValues}}{{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} {{{name}}}({{{value}}}){{^-last}}, @@ -30,7 +30,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -41,8 +41,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/formParams.mustache index bb84392b9c31..ec1f31d77ace 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/formParams.mustache @@ -1,2 +1,2 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/isFile}}{{#isFile}} +{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/isFile}}{{#isFile}} {{^isArray}} @FormDataParam("{{baseName}}") FormDataBodyPart {{paramName}}Bodypart {{/isArray}}{{#isArray}} @FormDataParam("{{baseName}}") List {{paramName}}Bodypart {{/isArray}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/headerParams.mustache index 1360d796826b..59bc49382517 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache index a8b1cafb8f9d..d7299149e05a 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache @@ -42,7 +42,7 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} @@ -50,7 +50,7 @@ public class {{classname}} { {{/-last}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) public Response {{nickname}}( {{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}, {{/allParams}}@Context SecurityContext securityContext) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache index d02af8c3d3d3..1ac5c8f37a97 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}{{^vendorExtensions.x-multipart}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/vendorExtensions.x-multipart}}{{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/isFile}}{{#isFile}}{{^isArray}}@FormDataParam("{{baseName}}") FormDataBodyPart {{paramName}}Bodypart{{/isArray}}{{#isArray}}@FormDataParam("{{baseName}}") List {{paramName}}Bodypart{{/isArray}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{^vendorExtensions.x-multipart}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}){{/vendorExtensions.x-multipart}}{{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/isFile}}{{#isFile}}{{^isArray}}@FormDataParam("{{baseName}}") FormDataBodyPart {{paramName}}Bodypart{{/isArray}}{{#isArray}}@FormDataParam("{{baseName}}") List {{paramName}}Bodypart{{/isArray}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/licenseInfo.mustache index abc2f4578eb3..c66209f27947 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/modelEnum.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/modelEnum.mustache index bff968c46894..ba82ea473b43 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/modelEnum.mustache @@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonValue; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -39,8 +39,8 @@ import com.fasterxml.jackson.annotation.JsonValue; {{#jackson}} @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pathParams.mustache index 15a08e20b059..8287f8d6a530 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pathParams.mustache @@ -3,7 +3,7 @@ }}@ApiParam(value = "{{{description}}}"{{! }}{{#required}}, required = true{{/required}}{{! }}{{#allowableValues}}, {{> allowableValues}}{{/allowableValues}}{{! - }}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}{{! + }}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{! }}){{! }} @PathParam("{{baseName}}"){{! diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache index 637add30c23b..e55b7e957246 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache @@ -1,7 +1,7 @@ /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + * {{description}}{{^description}}{{classname}}{{/description}} */{{#description}} -@ApiModel(description = "{{{description}}}"){{/description}} +@ApiModel(description = "{{{.}}}"){{/description}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} @@ -10,7 +10,7 @@ }) {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}} {{#isEnum}} {{^isContainer}} @@ -70,16 +70,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} **/ @@ -89,7 +89,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#jackson}} @JsonProperty(value = "{{baseName}}"{{#isReadOnly}}, access = JsonProperty.Access.READ_ONLY{{/isReadOnly}}{{#isWriteOnly}}, access = JsonProperty.Access.WRITE_ONLY{{/isWriteOnly}}) {{/jackson}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache index dc2a043addb8..3c3b77b82c37 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache @@ -13,7 +13,7 @@ repo - + src/main/java @@ -181,7 +181,7 @@ ${commons_io_version} {{/supportJava6}} - + {{#useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/queryParams.mustache index 2600cbe75186..18a82c524a60 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/queryParams.mustache @@ -4,7 +4,7 @@ }}{{#required}}, required = true{{/required}}{{! }}{{^isContainer}}{{! }}{{#allowableValues}}, {{> allowableValues}}{{/allowableValues}}{{! - }}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}{{! + }}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{! }}{{/isContainer}}{{! }}){{! diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/ApiResponseMessage.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/ApiResponseMessage.mustache index f47a5350943b..c883e16b5e6c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/ApiResponseMessage.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/ApiResponseMessage.mustache @@ -14,9 +14,9 @@ public class ApiResponseMessage { int code; String type; String message; - + public ApiResponseMessage(){} - + public ApiResponseMessage(int code, String message){ this.code = code; switch(code){ diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/allowableValues.mustache index a48256d027a1..75bce9385dea 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{min}}{{^min}}-infinity{{/min}}, {{max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/api.mustache index 4b4575440beb..5cdf6ea0be07 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/api.mustache @@ -42,7 +42,7 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} @@ -50,7 +50,7 @@ public class {{classname}} { {{/-last}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}}, + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}}, {{/-last}}{{/responses}} }) public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}@Context SecurityContext securityContext) throws NotFoundException { diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache index 1f9f43e7b868..ff4ffe26c497 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache @@ -4,17 +4,17 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationHeaderParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationHeaderParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationHeaderParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/bodyParams.mustache index eec07e9062da..879b7f2fc0cc 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#useBeanValidation}}{{#required}} @NotNull{{/required}} @Valid{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}){{#useBeanValidation}}{{#required}} @NotNull{{/required}} @Valid{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache index 923d26477d9b..3750df40bf87 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache @@ -26,8 +26,8 @@ public class JacksonConfig implements ContextResolver { public JacksonConfig() throws Exception { this.objectMapper = new ObjectMapper(); - -{{#java8}} + +{{#java8}} this.objectMapper.registerModule(new JavaTimeModule()); {{/java8}} {{^java8}} @@ -37,7 +37,7 @@ public class JacksonConfig implements ContextResolver { // sample to convert any DateTime to readable timestamps //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); } - + public ObjectMapper getContext(Class objectType) { return objectMapper; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache index 0f9c4b28e86b..d68fdfd4adfb 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache @@ -13,7 +13,7 @@ import io.swagger.jaxrs.config.BeanConfig; {{#apis}} import {{package}}.impl.{{classname}}ServiceImpl; {{/apis}} -{{/apiInfo}} +{{/apiInfo}} @ApplicationPath("{{{contextPath}}}") public class RestApplication extends Application { @@ -40,12 +40,12 @@ public class RestApplication extends Application { {{#apis}} resources.add({{classname}}ServiceImpl.class); {{/apis}} -{{/apiInfo}} +{{/apiInfo}} -{{#useSwaggerFeature}} +{{#useSwaggerFeature}} resources.add(io.swagger.jaxrs.listing.ApiListingResource.class); resources.add(io.swagger.jaxrs.listing.SwaggerSerializers.class); -{{/useSwaggerFeature}} +{{/useSwaggerFeature}} return resources; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/allowableValues.mustache index a48256d027a1..75bce9385dea 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{min}}{{^min}}-infinity{{/min}}, {{max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache index e2dfc12d9056..db3a8fb34301 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache @@ -30,13 +30,13 @@ import javax.validation.Valid; {{>generatedAnnotation}} {{#operations}} public interface {{classname}} { - + {{#operation}} @{{httpMethod}} {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} @@ -44,7 +44,7 @@ public interface {{classname}} { {{/-last}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}}, + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}}, {{/-last}}{{/responses}} }) public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}@Context SecurityContext securityContext); {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationCore.mustache index ae26b2739f1e..d6e2f13b457c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationCore.mustache @@ -1,20 +1,20 @@ -{{#pattern}} @Pattern(regexp="{{{pattern}}}"){{/pattern}}{{! +{{#pattern}} @Pattern(regexp="{{{.}}}"){{/pattern}}{{! minLength && maxLength set }}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationHeaderParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationHeaderParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationHeaderParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache index eec07e9062da..879b7f2fc0cc 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#useBeanValidation}}{{#required}} @NotNull{{/required}} @Valid{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}){{#useBeanValidation}}{{#required}} @NotNull{{/required}} @Valid{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache index 6e41c39177f6..5dca420a51c0 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} {{{name}}}({{{value}}}){{^-last}}, @@ -12,7 +12,7 @@ {{/allowableValues}} private {{dataType}} value; - {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) { + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) { this.value = value; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache index 79d5e482e3d0..1d72d944c2fd 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}) @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache index 6dafce8fe79b..3e047779034f 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}) @HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache index 343fe1933b1f..eaa4f0a0d6a5 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache @@ -1,7 +1,7 @@ import io.swagger.annotations.*; -{{#description}}@ApiModel(description="{{{description}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +{{#description}}@ApiModel(description="{{{.}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#serializableModel}} private static final long serialVersionUID = 1L; {{/serializableModel}} @@ -11,22 +11,22 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} - private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}};{{/vars}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/vars}} {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} **/ {{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") @JsonProperty("{{baseName}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache index 48d331f4aee3..6f7f2c245150 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache @@ -166,7 +166,7 @@ 2.9.9 {{/java8}} - + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache index 86b8bdf7b5b8..88a7eb85a2f8 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}}{{/isContainer}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache index be8e25fc2c69..0a3de16aea92 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache @@ -2,8 +2,8 @@ - - resteasy.providers + + resteasy.providers {{invokerPackage}}.JacksonConfig diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/enumClass.mustache index 6e41c39177f6..5dca420a51c0 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/enumClass.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} {{{name}}}({{{value}}}){{^-last}}, @@ -12,7 +12,7 @@ {{/allowableValues}} private {{dataType}} value; - {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) { + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) { this.value = value; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/formParams.mustache index 79d5e482e3d0..1d72d944c2fd 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}) @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/headerParams.mustache index 6dafce8fe79b..3e047779034f 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}) @HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache index 4478f50ae29a..f962101b9880 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache @@ -1,7 +1,7 @@ import io.swagger.annotations.*; -{{#description}}@ApiModel(description="{{{description}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +{{#description}}@ApiModel(description="{{{.}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#serializableModel}} private static final long serialVersionUID = 1L; {{/serializableModel}} @@ -10,22 +10,22 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} - private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}};{{/vars}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/vars}} {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} **/ {{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") @JsonProperty("{{baseName}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache index 997588b8b754..f233909cbd79 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache @@ -184,8 +184,8 @@ 1.1.0.Final provided -{{/useBeanValidation}} - +{{/useBeanValidation}} + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/queryParams.mustache index 86b8bdf7b5b8..88a7eb85a2f8 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}}{{/isContainer}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiInterface.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiInterface.mustache index e4bf4e05bfad..0fcf5420c282 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiInterface.mustache @@ -9,5 +9,5 @@ {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{^-last}},{{/-last}}{{/responses}} }){{/useSwaggerAnnotations}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}){{^-last}},{{/-last}}{{/responses}} }){{/useSwaggerAnnotations}} {{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{>returnTypeInterface}}{{/returnResponse}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiMethod.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiMethod.mustache index 09db050cd767..d6c4ae7c82c1 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiMethod.mustache @@ -2,14 +2,14 @@ @Path("{{{path}}}"){{/subresourceOperation}}{{#hasConsumes}} @Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}} @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}}{{#useSwaggerAnnotations}} - @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}{{#isOAuth}}@Authorization(value = "{{name}}", scopes = { {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}} {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }){{/useSwaggerAnnotations}} public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { return Response.ok().entity("magic!").build(); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache index ae26b2739f1e..d6e2f13b457c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache @@ -1,20 +1,20 @@ -{{#pattern}} @Pattern(regexp="{{{pattern}}}"){{/pattern}}{{! +{{#pattern}} @Pattern(regexp="{{{.}}}"){{/pattern}}{{! minLength && maxLength set }}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationHeaderParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationHeaderParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationHeaderParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache index f8eef8f94c7b..c4ff01d7e552 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/cookieParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/cookieParams.mustache index 71dbe46aba2a..0d015d6cf68f 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/cookieParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/cookieParams.mustache @@ -1 +1 @@ -{{#isCookieParam}}@CookieParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{description}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isCookieParam}} \ No newline at end of file +{{#isCookieParam}}@CookieParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache index 9a4bb71d9d75..4b1114571539 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache @@ -23,7 +23,7 @@ @JsonCreator public static {{datatypeWithEnum}} fromValue({{dataType}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache index dd9020ea9b8f..66f6745ff9fd 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache @@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonValue; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -32,8 +32,8 @@ import com.fasterxml.jackson.annotation.JsonValue; } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/headerParams.mustache index 77f98a049344..4f978d3c36b3 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@HeaderParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{description}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@HeaderParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} {{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/README.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/README.mustache index 1f328b17165e..d7982e6e6a66 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/README.mustache @@ -5,7 +5,7 @@ This server was generated by the [OpenAPI Generator](https://openapi-generator.t [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled JAX-RS server. -This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and the [Eclipse-MicroProfile-OpenAPI](https://github.com/eclipse/microprofile-open-api) addition. The pom file is configured to use [Helidon](https://helidon.io/) as application server. diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/MANIFEST.MF.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/MANIFEST.MF.mustache index e3c07ab38a4e..65b9fe16a698 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/MANIFEST.MF.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/MANIFEST.MF.mustache @@ -1,2 +1,2 @@ Manifest-Version: 1.0 -Class-Path: +Class-Path: diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/README.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/README.mustache index f3389b0ef037..21a76d827106 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/README.mustache @@ -5,7 +5,7 @@ This server was generated by the [OpenAPI Generator](https://openapi-generator.t [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled JAX-RS server. -This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and the [Eclipse-MicroProfile-OpenAPI](https://github.com/eclipse/microprofile-open-api) addition. The pom file is configured to use [Open Liberty](https://openliberty.io/) as application server. diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/server.xml.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/server.xml.mustache index 176088c512db..d765cfbdc77f 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/server.xml.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/server.xml.mustache @@ -10,10 +10,10 @@ - + - + \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/README.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/README.mustache index 90433afce82b..6c5ef2f11dd0 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/README.mustache @@ -5,7 +5,7 @@ This server was generated by the [OpenAPI Generator](https://openapi-generator.t [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled JAX-RS server. -This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and the [Eclipse-MicroProfile-OpenAPI](https://github.com/eclipse/microprofile-open-api) addition. The pom file is configured to use [Quarkus](https://quarkus.io/) as application server. diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/thorntail/README.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/thorntail/README.mustache index 64d4830d4b8b..66e31f3b0c7a 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/thorntail/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/thorntail/README.mustache @@ -5,7 +5,7 @@ This server was generated by the [OpenAPI Generator](https://openapi-generator.t [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled JAX-RS server. -This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and the [Eclipse-MicroProfile-OpenAPI](https://github.com/eclipse/microprofile-open-api) addition. The pom file is configured to use [Thorntail](https://thorntail.io) as application server. diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pathParams.mustache index 5c3d731f8388..922e107830ca 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}@PathParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{description}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}@PathParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache index 90430584ba7c..5e008a5de884 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache @@ -7,26 +7,26 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; {{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{#description}}/** - * {{description}} + * {{.}} **/{{/description}} -{{#useSwaggerAnnotations}}{{#description}}@ApiModel(description = "{{{description}}}"){{/description}}{{/useSwaggerAnnotations}} -{{>generatedAnnotation}}{{>additionalModelTypeAnnotations}}public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +{{#useSwaggerAnnotations}}{{#description}}@ApiModel(description = "{{{.}}}"){{/description}}{{/useSwaggerAnnotations}} +{{>generatedAnnotation}}{{>additionalModelTypeAnnotations}}public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} - + {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} private {{#useBeanValidation}}@Valid {{/useBeanValidation}}{{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/vars}} {{#vars}}/** {{#description}} - * {{description}} + * {{.}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} **/ public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { @@ -41,7 +41,7 @@ import com.fasterxml.jackson.annotation.JsonValue; }{{/generateBuilders}} {{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}}{{#useSwaggerAnnotations}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{/useSwaggerAnnotations}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{/useSwaggerAnnotations}} @JsonProperty("{{baseName}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; @@ -143,13 +143,13 @@ import com.fasterxml.jackson.annotation.JsonValue; {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} **/ public Builder {{name}}({{{datatypeWithEnum}}} {{name}}) { diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/queryParams.mustache index 198098046c02..31ea97fd3507 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{description}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidation.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidation.mustache index 978069fbeecb..2e510dc091b1 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidation.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidation.mustache @@ -2,7 +2,7 @@ @NotNull {{/required}} {{#pattern}} -@Pattern(regexp="{{{pattern}}}") +@Pattern(regexp="{{{.}}}") {{/pattern}} {{#minLength}} {{#maxLength}} @@ -16,7 +16,7 @@ {{/minLength}} {{^minLength}} {{#maxLength}} -@Size(max={{maxLength}}) +@Size(max={{.}}) {{/maxLength}} {{/minLength}} {{#minItems}} @@ -31,24 +31,24 @@ {{/minItems}} {{^minItems}} {{#maxItems}} -@Size(max={{maxItems}}) +@Size(max={{.}}) {{/maxItems}} {{/minItems}} {{! check for integer / number=decimal type}} {{#isInteger}} {{#minimum}} -@Min({{minimum}}) +@Min({{.}}) {{/minimum}} {{#maximum}} -@Max({{maximum}}) +@Max({{.}}) {{/maximum}} {{/isInteger}} {{^isInteger}} {{#minimum}} -@DecimalMin("{{minimum}}") +@DecimalMin("{{.}}") {{/minimum}} {{#maximum}} -@DecimalMax("{{maximum}}") +@DecimalMax("{{.}}") {{/maximum}} {{/isInteger}} {{^isPrimitiveType}} diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidationCore.mustache index cf3c47f906e7..56f6eb83669e 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidationCore.mustache @@ -1 +1 @@ -{{#pattern}}{{^isByteArray}} @Pattern(regexp="{{{pattern}}}"){{/isByteArray}}{{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#pattern}}{{^isByteArray}} @Pattern(regexp="{{{pattern}}}"){{/isByteArray}}{{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/conversionBegin.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/conversionBegin.mustache index 199542872028..a8239f5868ca 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/conversionBegin.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/conversionBegin.mustache @@ -1 +1 @@ -{{#isBoolean}}Boolean.valueOf({{/isBoolean}}{{#isInteger}}Integer.parseInt({{/isInteger}}{{#isDouble}}Double.parseDouble({{/isDouble}}{{#isLong}}Long.parseLong({{/isLong}}{{#isFloat}}Float.parseFloat({{/isFloat}}{{#isUuid}}UUID.fromString({{/isUuid}}{{#isDateTime}}OffsetDateTime.parse({{/isDateTime}}{{#isDate}}LocalDate.parse({{/isDate}}{{#isByteArray}}{{/isByteArray}}{{#isNumber}}new BigDecimal({{/isNumber}} \ No newline at end of file +{{#isBoolean}}Boolean.valueOf({{/isBoolean}}{{#isInteger}}Integer.parseInt({{/isInteger}}{{#isDouble}}Double.parseDouble({{/isDouble}}{{#isLong}}Long.parseLong({{/isLong}}{{#isFloat}}Float.parseFloat({{/isFloat}}{{#isUuid}}UUID.fromString({{/isUuid}}{{#isDateTime}}OffsetDateTime.parse({{/isDateTime}}{{#isDate}}LocalDate.parse({{/isDate}}{{#isNumber}}new BigDecimal({{/isNumber}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumClass.mustache index 0e53213ed49c..6afccd29a237 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumClass.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}} {{#enumVars}} @@ -22,7 +22,7 @@ private final {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -33,8 +33,8 @@ } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumOuterClass.mustache index 29e50e1b428d..9ffcc2ddcac7 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumOuterClass.mustache @@ -3,9 +3,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; private final {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -31,8 +31,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/itemConversionBegin.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/itemConversionBegin.mustache index 42b024ec3407..83ec7d22210c 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/itemConversionBegin.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/itemConversionBegin.mustache @@ -1 +1 @@ -{{#items.isBoolean}}Boolean.valueOf({{/items.isBoolean}}{{#items.isInteger}}Integer.parseInt({{/items.isInteger}}{{#items.isDouble}}Double.parseDouble({{/items.isDouble}}{{#items.isLong}}Long.parseLong({{/items.isLong}}{{#items.isFloat}}Float.parseFloat({{/items.isFloat}}{{#items.isUuid}}UUID.fromString({{/items.isUuid}}{{#items.isDateTime}}OffsetDateTime.parse({{/items.isDateTime}}{{#items.isDate}}LocalDate.parse({{/items.isDate}}{{#isByteArray}}{{/isByteArray}}{{#isNumber}}new BigDecimal({{/isNumber}} \ No newline at end of file +{{#items.isBoolean}}Boolean.valueOf({{/items.isBoolean}}{{#items.isInteger}}Integer.parseInt({{/items.isInteger}}{{#items.isDouble}}Double.parseDouble({{/items.isDouble}}{{#items.isLong}}Long.parseLong({{/items.isLong}}{{#items.isFloat}}Float.parseFloat({{/items.isFloat}}{{#items.isUuid}}UUID.fromString({{/items.isUuid}}{{#items.isDateTime}}OffsetDateTime.parse({{/items.isDateTime}}{{#items.isDate}}LocalDate.parse({{/items.isDate}}{{#isNumber}}new BigDecimal({{/isNumber}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache index d25b2b8be695..f96ed1ee9a4d 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache @@ -3,11 +3,11 @@ import java.util.Objects; import javax.validation.constraints.*; {{/useBeanValidation}} /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + * {{description}}{{^description}}{{classname}}{{/description}} */ {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}} {{#isEnum}} {{^isContainer}} @@ -15,7 +15,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/isContainer}} {{#isContainer}} {{#mostInnerItems}} -{{>enumClass}} +{{>enumClass}} {{/mostInnerItems}} {{/isContainer}} {{/isEnum}} @@ -71,16 +71,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali /** {{#description}} - * {{{description}}} + * {{{.}}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} **/ diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index 5a9522ffcfd0..ecf4ad39ba67 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -102,14 +102,14 @@ public interface {{classname}} { {{#virtualService}} @ApiVirtual {{/virtualService}} - @ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, response = {{{returnBaseType}}}.class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, response = {{{.}}}.class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}{{#isOAuth}}@Authorization(value = "{{name}}", scopes = { {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}} {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{baseType}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) {{#implicitHeaders}} @ApiImplicitParams({ {{#headerParams}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache index cc394980f786..c7331c0cfe5e 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache @@ -4,21 +4,21 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}}@Size(min={{minLength}}) {{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}}@Size(max={{maxLength}}) {{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}}@Size(max={{.}}) {{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}}@Size(min={{minItems}},max={{maxItems}}) {{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}}@Size(min={{minItems}}) {{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}}@Size(max={{maxItems}}) {{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}}@Size(max={{.}}) {{/maxItems}}{{/minItems}}{{! @Email: useBeanValidation set && isEmail && java8 set }}{{#useBeanValidation}}{{#isEmail}}{{#java8}}@javax.validation.constraints.Email{{/java8}}{{/isEmail}}{{/useBeanValidation}}{{! @Email: performBeanValidation set && isEmail && not java8 set }}{{#performBeanValidation}}{{#isEmail}}{{^java8}}@org.hibernate.validator.constraints.Email{{/java8}}{{/isEmail}}{{/performBeanValidation}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}}@Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}) {{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}}@Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}) {{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}}@Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L) {{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}}@Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L) {{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}}@DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}) {{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache index 83780c73ae31..a7352af18097 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{.}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache index e21bd9ff4bfb..93759b0f3129 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache @@ -1 +1 @@ -{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) @CookieValue("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isCookieParam}} \ No newline at end of file +{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) @CookieValue("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache index 35b2bba8f628..59fa30eca3e5 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}} {{#enumVars}} @@ -22,7 +22,7 @@ private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -39,8 +39,8 @@ } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache index 334bfb6640b7..387e4c30c860 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache @@ -3,9 +3,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -37,8 +37,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache index f3291733ee47..051c24cdf6cf 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache index 2e2d907f583b..6de7ead10608 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) @RequestHeader(value="{{baseName}}", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) @RequestHeader(value="{{baseName}}", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache index c89e7cf63853..196292339da4 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache @@ -1,9 +1,9 @@ {{^interfaceOnly}}# OpenAPI generated server -Spring Boot Server +Spring Boot Server -## Overview +## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. @@ -15,7 +15,7 @@ The underlying library integrating OpenAPI to SpringBoot is [springfox](https:// Start your server as a simple java application {{^reactive}} -You can view the api documentation in swagger-ui by pointing to +You can view the api documentation in swagger-ui by pointing to http://localhost:{{serverPort}}/ {{/reactive}} @@ -52,9 +52,9 @@ public interface PetClient extends PetApi { ## Virtualan : -You can view Virtualan UI by pointing to +You can view Virtualan UI by pointing to http://localhost:8080//virtualan-ui.html -How to use guide available in the Virtualan wiki +How to use guide available in the Virtualan wiki https://github.com/virtualansoftware/virtualan/wiki {{/virtualService}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache index 0eb66fdee5a7..1be37a65d96b 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") @RequestParam("{{baseName}}") {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{.}}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") @RequestParam("{{baseName}}") {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache index d28df1b43b4b..efc3e8921a6c 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache @@ -11,4 +11,4 @@ The underlying library integrating OpenAPI to Spring-MVC is [springfox](https:// {{/useSpringfox}} You can view the server in swagger-ui by pointing to -http://localhost:{{serverPort}}{{^contextPath}}/{{/contextPath}}{{#contextPath}}{{contextPath}}{{/contextPath}}/ \ No newline at end of file +http://localhost:{{serverPort}}{{contextPath}}{{^contextPath}}/{{/contextPath}}/ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache index fbda18ab83c9..e7ca6777fcaa 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache @@ -38,7 +38,7 @@ ${jetty-version} - {{^contextPath}}/{{/contextPath}}{{#contextPath}}{{contextPath}}{{/contextPath}} + {{contextPath}}{{^contextPath}}/{{/contextPath}} target/${project.artifactId}-${project.version} 8079 diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache index 44cc98fff1cd..af17f0c4d961 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index de2f292341ea..df0b98bfaf7f 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -1,9 +1,9 @@ /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + * {{description}}{{^description}}{{classname}}{{/description}} */{{#description}} -@ApiModel(description = "{{{description}}}"){{/description}} +@ApiModel(description = "{{{.}}}"){{/description}} {{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}{{>additionalModelTypeAnnotations}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}}{{#hateoas}}extends RepresentationModel<{{classname}}> {{/hateoas}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{^parent}}{{#hateoas}}extends RepresentationModel<{{classname}}> {{/hateoas}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -14,14 +14,14 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}} {{>enumClass}} {{/isContainer}} {{#isContainer}} - {{#mostInnerItems}} + {{#mostInnerItems}} {{>enumClass}} {{/mostInnerItems}} {{/isContainer}} {{/isEnum}} {{#jackson}} @JsonProperty("{{baseName}}"){{#withXml}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"){{/withXml}} + @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"){{/withXml}} {{/jackson}} {{#gson}} @SerializedName("{{baseName}}") @@ -96,23 +96,23 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}} /** {{#description}} - * {{{description}}} + * {{{.}}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} */ {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{>nullableDataType}} {{getter}}() { return {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache index fc630e6361ee..3d61a40f0581 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/xmlAnnotation.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/xmlAnnotation.mustache index fd81a4cf5d84..70e2626635f4 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/xmlAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/xmlAnnotation.mustache @@ -1,6 +1,6 @@ {{#withXml}} {{#jackson}} -@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") +@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") {{/jackson}} -@XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") +@XmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") @XmlAccessorType(XmlAccessType.FIELD){{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/AsyncMethod.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/AsyncMethod.mustache index 13725c9212e1..4f790cf0f568 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/AsyncMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/AsyncMethod.mustache @@ -1 +1 @@ - void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{#-last}}, {{/-last}}{{/allParams}}Handler> handler); \ No newline at end of file + void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{#-last}}, {{/-last}}{{/allParams}}Handler> handler); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiException.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiException.mustache index 2e2b887a1176..27cf89ab06a9 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiException.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiException.mustache @@ -17,6 +17,6 @@ public class MainApiException extends Exception { public String getStatusMessage() { return statusMessage; } - - public static final MainApiException INTERNAL_SERVER_ERROR = new MainApiException(500, "Internal Server Error"); + + public static final MainApiException INTERNAL_SERVER_ERROR = new MainApiException(500, "Internal Server Error"); } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiVerticle.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiVerticle.mustache index 034d83b8f21e..594d423d40b9 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiVerticle.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiVerticle.mustache @@ -50,7 +50,7 @@ public class MainApiVerticle extends AbstractVerticle { deployVerticles(startFuture); vertx.createHttpServer() - .requestHandler(swaggerRouter::accept) + .requestHandler(swaggerRouter::accept) .listen(serverPort, h -> { if (h.succeeded()) { startFuture.complete(); @@ -61,9 +61,9 @@ public class MainApiVerticle extends AbstractVerticle { } else { startFuture.fail(readFile.cause()); } - }); + }); } - + public void deployVerticles(Future startFuture) { {{#apiInfo}}{{#apis}} vertx.deployVerticle("{{apiPackage}}.{{classname}}Verticle", res -> { diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/RxMethod.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/RxMethod.mustache index fd183f08805f..5361709387f5 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/RxMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/RxMethod.mustache @@ -1 +1 @@ - public {{#returnType}}Single<{{{returnType}}}>{{/returnType}}{{^returnType}}Completable{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file + public {{#returnType}}Single<{{{.}}}>{{/returnType}}{{^returnType}}Completable{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/api.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/api.mustache index 920bbd92ea02..183d23c28eb6 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/api.mustache @@ -25,7 +25,7 @@ public interface {{classname}} { {{^rxInterface}} {{>AsyncMethod}} {{/rxInterface}} - + {{/operation}} {{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/apiException.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/apiException.mustache index f3b495dfb4cb..5678721bd866 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/apiException.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/apiException.mustache @@ -7,7 +7,7 @@ public final class {{classname}}Exception extends MainApiException { public {{classname}}Exception(int statusCode, String statusMessage) { super(statusCode, statusMessage); } - + {{#operations}}{{#operation}}{{#responses}}{{^isDefault}}public static final {{classname}}Exception {{baseName}}_{{{operationId}}}_{{{code}}}_Exception = new {{classname}}Exception({{{code}}}, "{{{message}}}"); {{/isDefault}}{{/responses}}{{/operation}}{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/apiVerticle.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/apiVerticle.mustache index 84a896245fb9..297495efb232 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/apiVerticle.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/apiVerticle.mustache @@ -16,7 +16,7 @@ import java.util.Map; public class {{classname}}Verticle extends AbstractVerticle { static final Logger LOGGER = LoggerFactory.getLogger({{classname}}Verticle.class); - + {{#operations}}{{#operation}}{{#vendorExtensions}}static final String {{x-serviceid-varname}} = "{{x-serviceid}}"; {{/vendorExtensions}}{{/operation}}{{/operations}} final {{classname}} service; @@ -52,7 +52,7 @@ public class {{classname}}Verticle extends AbstractVerticle { Json.mapper.getTypeFactory().constructCollectionType(List.class, {{{baseType}}}.class)); {{/required}} {{^required}} - {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param.encode(), + {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param.encode(), Json.mapper.getTypeFactory().constructCollectionType(List.class, {{{baseType}}}.class)); {{/required}} {{/isArray}} @@ -81,7 +81,7 @@ public class {{classname}}Verticle extends AbstractVerticle { {{{dataType}}} {{paramName}} = Json.mapper.readValue({{paramName}}Param, {{{dataType}}}.class); {{/required}} {{^required}} - {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param, {{{dataType}}}.class); + {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param, {{{dataType}}}.class); {{/required}} {{/isString}} {{/isPrimitiveType}} @@ -109,7 +109,7 @@ public class {{classname}}Verticle extends AbstractVerticle { }); {{/operation}}{{/operations}} } - + private void manageError(Message message, Throwable cause, String serviceName) { int code = MainApiException.INTERNAL_SERVER_ERROR.getStatusCode(); String statusMessage = MainApiException.INTERNAL_SERVER_ERROR.getStatusMessage(); @@ -117,12 +117,12 @@ public class {{classname}}Verticle extends AbstractVerticle { code = ((MainApiException)cause).getStatusCode(); statusMessage = ((MainApiException)cause).getStatusMessage(); } else { - logUnexpectedError(serviceName, cause); + logUnexpectedError(serviceName, cause); } - + message.fail(code, statusMessage); } - + private void logUnexpectedError(String serviceName, Throwable cause) { LOGGER.error("Unexpected error in "+ serviceName, cause); } diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/enumOuterClass.mustache index 58748fd18b26..0db4c7380792 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/enumOuterClass.mustache @@ -2,16 +2,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} {{{name}}}({{{value}}}){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -25,8 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; return String.valueOf(value); } - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/model.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/model.mustache index 46f9f77357df..816b64ebc526 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/model.mustache @@ -6,7 +6,7 @@ import java.util.Objects; {{#serializableModel}}import java.io.Serializable; {{/serializableModel}}{{#models}}{{#model}}{{#description}} /** - * {{description}} + * {{.}} **/ {{/description}}{{^description}} {{/description}}{{#isEnum}}{{>enumOuterClass}}{{/isEnum}}{{^isEnum}}{{>pojo}}{{/isEnum}}{{/model}}{{/models}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/pojo.mustache index a2d809a9e7f4..cbcff066b1b7 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/pojo.mustache @@ -1,5 +1,5 @@ {{>additionalModelTypeAnnotations}}@JsonInclude(JsonInclude.Include.NON_NULL) -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache index d12dcba44b11..3fdedc85a2a7 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache @@ -1,14 +1,14 @@ 4.0.0 - + {{groupId}} {{artifactId}} {{artifactVersion}} jar - + {{appName}} - + UTF-8 1.8 diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/enumOuterClass.mustache index a7b818b228fb..8d64ba3eb884 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/enumOuterClass.mustache @@ -2,16 +2,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} {{{name}}}({{{value}}}){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -25,8 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; return String.valueOf(value); } - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/model.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/model.mustache index 46f9f77357df..816b64ebc526 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/model.mustache @@ -6,7 +6,7 @@ import java.util.Objects; {{#serializableModel}}import java.io.Serializable; {{/serializableModel}}{{#models}}{{#model}}{{#description}} /** - * {{description}} + * {{.}} **/ {{/description}}{{^description}} {{/description}}{{#isEnum}}{{>enumOuterClass}}{{/isEnum}}{{^isEnum}}{{>pojo}}{{/isEnum}}{{/model}}{{/models}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/pojo.mustache index a2d809a9e7f4..cbcff066b1b7 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/pojo.mustache @@ -1,5 +1,5 @@ {{>additionalModelTypeAnnotations}}@JsonInclude(JsonInclude.Include.NON_NULL) -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/ApiResponse.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/ApiResponse.mustache index f1a435bdcc88..4554dd577ae8 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/ApiResponse.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/ApiResponse.mustache @@ -33,5 +33,3 @@ public class ApiResponse { return statusCode; } } - - diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/ApiClient.mustache index 445e1cef2b86..8914ecf5e449 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/ApiClient.mustache @@ -3,20 +3,20 @@ import RESTDataSource from 'apollo-datasource-rest'; {{#emitJSDoc}}/** -* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient +* @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient * @version {{projectVersion}} */ /** * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an * application to use this class directly - the *Api and model classes provide the public API for the service. -* @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient +* @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient * @class */{{/emitJSDoc}} export default class ApiClient extends RESTDataSource { constructor() { super() - + {{#emitJSDoc}}/** * The authentication methods to be included for all API calls. * @type {Array.} @@ -187,7 +187,7 @@ export default class ApiClient extends RESTDataSource { this.applyAuthOptions(fetchOptions, authNames); var body = null; - + if (bodyParam !== null && bodyParam !== undefined) { body = bodyParam; } else if (formParams !== null && formParams !== undefined) { diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/README.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/README.mustache index dd4a6721a2d7..0ac4e62d2f53 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/README.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/README.mustache @@ -2,7 +2,7 @@ {{moduleName}} - JavaScript client for {{projectName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -64,11 +64,11 @@ npm run build #### git -If the library is hosted at a git repository, e.g.https://github.com/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} +If the library is hosted at a git repository, e.g.https://github.com/{{gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} then install it via: ```shell - npm install {{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save + npm install {{gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save ``` ### For browser @@ -181,7 +181,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}.{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}.{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_doc.mustache index ab08ff8495b6..0a68747b73d7 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_doc.mustache @@ -1,12 +1,12 @@ # {{moduleName}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{operationId}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -92,7 +92,7 @@ apiInstance.{{{operationId}}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/- {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_test.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_test.mustache index e56b66d47e36..f04f1bc3cce7 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_test.mustache @@ -1,6 +1,6 @@ {{>licenseInfo}} // CommonJS-like environments that support module.exports, like Node. -factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index')); +factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index')); 'use strict'; diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/index.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/index.mustache index 36b8a2032d14..56213101a340 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/index.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/index.mustache @@ -1,17 +1,17 @@ {{>licenseInfo}} import ApiClient from './ApiClient'; -{{#models}}import {{#model}}{{classFilename}}{{/model}} from './{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'; -{{/models}}{{#apiInfo}}{{#apis}}import {{importPath}} from './{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'; +{{#models}}import {{#model}}{{classFilename}}{{/model}} from './{{#modelPackage}}{{.}}/{{/modelPackage}}{{importPath}}'; +{{/models}}{{#apiInfo}}{{#apis}}import {{importPath}} from './{{#apiPackage}}{{.}}/{{/apiPackage}}{{importPath}}'; {{/apis}}{{/apiInfo}} {{#emitJSDoc}}/**{{#projectDescription}} -* {{projectDescription}}.
{{/projectDescription}} +* {{.}}.
{{/projectDescription}} * The index module provides access to constructors for all the classes which comprise the public API. *

* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: *

-* var {{moduleName}} = require('{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'); // See note below*.
+* var {{moduleName}} = require('{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'); // See note below*.
 * var xxxSvc = new {{moduleName}}.XxxApi(); // Allocate the API class we're going to use.
 * var yyyModel = new {{moduleName}}.Yyy(); // Construct a model instance.
 * yyyModel.someProperty = 'someValue';
@@ -19,7 +19,7 @@ import ApiClient from './ApiClient';
 * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
 * ...
 * 
-* *NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], function(){...}) +* *NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], function(){...}) * and put the application logic within the callback function. *

*

@@ -33,7 +33,7 @@ import ApiClient from './ApiClient'; * ... * *

-* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index +* @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}index * @version {{projectVersion}} */{{/emitJSDoc}} export { diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/licenseInfo.mustache index 40cac6d4a3c1..2a386a24226d 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_doc.mustache index 04ab6f949ac9..fc21ae6e9f1f 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_doc.mustache @@ -11,7 +11,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/vars}} {{#vars}}{{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_test.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_test.mustache index fb89dd977030..05a03a834590 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_test.mustache @@ -2,10 +2,10 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. - define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], factory); + define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index')); + factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index')); } else { // Browser globals (root is window) factory(root.expect, root.{{moduleName}}); diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/partial_model_generic.mustache index c16b43ec4d4d..bc69d91c3423 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/partial_model_generic.mustache @@ -1,7 +1,7 @@ {{#models}}{{#model}}{{#emitJSDoc}}/** * The {{classname}} model module. - * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} + * @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}} * @version {{projectVersion}} */{{/emitJSDoc}} class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}extends Array {{/vendorExtensions.x-is-array}}{{/parentModel}}{{/parent}}{ @@ -9,9 +9,9 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e {{#emitJSDoc}}/** * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}} * @type {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=>{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} + * @default {{{.}}}{{/defaultValue}} */{{/emitJSDoc}} - {{baseName}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}; + {{baseName}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/vars}} {{#useInheritance}}{{#interfaceModels}}{{#allVars}}{{#emitJSDoc}}/** @@ -23,11 +23,11 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e {{#emitJSDoc}}/** * Constructs a new {{classname}}.{{#description}} - * {{description}}{{/description}} - * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{#useInheritance}}{{#parent}} - * @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-is-array}}Array{{/vendorExtensions.x-is-array}}{{#vendorExtensions.x-is-map}}Object{{/vendorExtensions.x-is-map}}{{/parentModel}}{{/parent}}{{#interfaces}} - * @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} - * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}} + * {{.}}{{/description}} + * @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}}{{#useInheritance}}{{#parent}} + * @extends {{#parentModel}}module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-is-array}}Array{{/vendorExtensions.x-is-array}}{{#vendorExtensions.x-is-map}}Object{{/vendorExtensions.x-is-map}}{{/parentModel}}{{/parent}}{{#interfaces}} + * @implements module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} + * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{{description}}}{{/vendorExtensions.x-all-required}} */{{/emitJSDoc}} constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}} super(); diff --git a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/api.mustache b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/api.mustache index 069668e480c0..41a6f09bedeb 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/api.mustache @@ -4,8 +4,8 @@ * generated.{{#appDescription}} * * {{ appDescription }}{{/appDescription}}{{#version}} - * Version: {{version}}{{/version}}{{#appContact}} - * Contact: {{appContact}}{{/appContact}} + * Version: {{.}}{{/version}}{{#appContact}} + * Contact: {{.}}{{/appContact}} {{^hideGenerationTimestamp}} * Generated at: {{generatedDate}} {{/hideGenerationTimestamp}} @@ -13,7 +13,7 @@ */{{#licenseInfo}} /** * @license {{licenseInfo}}{{#licenseUrl}} - * {{licenseUrl}}{{/licenseUrl}} + * {{.}}{{/licenseUrl}} */ {{/licenseInfo}} @@ -60,7 +60,7 @@ goog.require('{{import}}'); * {{notes}}{{#allParams}} * @param {!{{{dataType}}}{{^required}}={{/required}}} {{^required}}opt_{{/required}}{{paramName}} {{description}}{{/allParams}} * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. - * @return {!angular.$q.Promise{{#returnType}}{{/returnType}}} + * @return {!angular.$q.Promise{{#returnType}}{{/returnType}}} */ {{package}}.{{classname}}.prototype.{{nickname}} = function({{#allParams}}{{^required}}opt_{{/required}}{{paramName}}, {{/allParams}}opt_extraHttpRequestParams) { /** @const {string} */ diff --git a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache index ffb877067836..17a5c8c446aa 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache @@ -4,8 +4,8 @@ * generated.{{#appDescription}} * * {{ appDescription }}{{/appDescription}}{{#version}} - * Version: {{version}}{{/version}}{{#appContact}} - * Contact: {{appContact}}{{/appContact}} + * Version: {{.}}{{/version}}{{#appContact}} + * Contact: {{.}}{{/appContact}} {{^hideGenerationTimestamp}} * Generated at: {{generatedDate}} {{/hideGenerationTimestamp}} @@ -13,7 +13,7 @@ */{{#licenseInfo}} /** * @license {{licenseInfo}}{{#licenseUrl}} - * {{licenseUrl}}{{/licenseUrl}} + * {{.}}{{/licenseUrl}} */ {{/licenseInfo}} diff --git a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/model.mustache b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/model.mustache index 97b9574f04c8..ef59e84148fd 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/model.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/model.mustache @@ -8,7 +8,7 @@ goog.provide('{{package}}.{{name}}'); {{#model}} /** {{#description}} - * {{{description}}} + * {{{.}}} {{/description}} * @record */ @@ -17,7 +17,7 @@ goog.provide('{{package}}.{{name}}'); /** {{#description}} - * {{{description}}} + * {{{.}}} {{/description}} {{! Explicitly force types to be non-nullable using !. This is redundant but valid }} * @type {!{{{dataType}}}} diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache index ccfed6298ec5..94c168b551bb 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache @@ -226,13 +226,13 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur }; export type {{classname}}Type = { {{#operation}} - {{operationId}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: RequestOptions): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Response{{/returnType}}>, + {{operationId}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: RequestOptions): Promise<{{{returnType}}}{{^returnType}}Response{{/returnType}}>, {{/operation}} } /** * {{classname}} - factory function to inject configuration {{#description}} - * {{{description}}}{{/description}} + * {{{.}}}{{/description}} * @export */ export const {{classname}} = function(configuration?: Configuration, fetch: FetchAPI = portableFetch): {{classname}}Type { @@ -246,7 +246,7 @@ export const {{classname}} = function(configuration?: Configuration, fetch: Fetc {{/summary}} * @throws {RequiredError} */ - {{operationId}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: RequestOptions = {}): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Response{{/returnType}}> { + {{operationId}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: RequestOptions = {}): Promise<{{{returnType}}}{{^returnType}}Response{{/returnType}}> { const localVarFetchArgs = {{classname}}FetchParamCreator(configuration).{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}options); return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/licenseInfo.mustache index 38c3c5188873..05f68fbd3f03 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/licenseInfo.mustache @@ -3,10 +3,10 @@ * {{{appDescription}}} * {{#version}} - * The version of the OpenAPI document: {{{version}}} + * The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI-Generator diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache index 143ca85238c4..1ed248653dbd 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache @@ -23,5 +23,4 @@ export type {{classname}} = { */ {{name}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}}; {{/vars}} -}{{#parent}} & {{parent}}{{/parent}} - +}{{#parent}} & {{.}}{{/parent}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache index 49f0c1f17e07..eebfd6bd884d 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache @@ -17,7 +17,7 @@ 'use strict'; {{#emitJSDoc}} /** - * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient + * @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient * @version {{projectVersion}} */ @@ -25,7 +25,7 @@ * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an * application to use this class directly - the *Api and model classes provide the public API for the service. The * contents of this file should be regarded as internal but are documented for completeness. - * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient + * @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient * @class */ {{/emitJSDoc}} var exports = function() { @@ -296,7 +296,7 @@ /** * Builds a string representation of an array-type actual parameter, according to the given collection format. * @param {Array} param An array parameter. - * @param {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. + * @param {module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns * param as is if collectionFormat is multi. */ @@ -397,7 +397,7 @@ {{#emitJSDoc}}{{^usePromises}} /** * Callback function to receive the result of the operation. - * @callback module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient~callApiCallback + * @callback module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient~callApiCallback * @param {String} error Error message, if any. * @param data The data returned by the service call. * @param {String} response The complete HTTP response. @@ -418,7 +418,7 @@ * @param {Array.} accepts An array of acceptable response MIME types. * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the * constructor for a complex type.{{^usePromises}} - * @param {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient~callApiCallback} callback The callback function.{{/usePromises}} + * @param {module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient~callApiCallback} callback The callback function.{{/usePromises}} * @returns {{#usePromises}}{Promise} A {@link https://www.promisejs.org/|Promise} object{{/usePromises}}{{^usePromises}}{Object} The SuperAgent request object{{/usePromises}}. */ {{/emitJSDoc}} exports.prototype.callApi = function callApi(path, httpMethod, pathParams, @@ -734,7 +734,7 @@ {{#emitJSDoc}} /** * The default API client implementation. - * @type {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient} + * @type {module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient} */ {{/emitJSDoc}} exports.instance = new exports(); diff --git a/modules/openapi-generator/src/main/resources/Javascript/README.mustache b/modules/openapi-generator/src/main/resources/Javascript/README.mustache index fccb79dce5b6..fbf461bdde46 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/README.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/README.mustache @@ -2,7 +2,7 @@ {{moduleName}} - JavaScript client for {{projectName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -54,11 +54,11 @@ You should now be able to `require('{{{projectName}}}')` in javascript files fro ### git -If the library is hosted at a git repository, e.g. https://github.com/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} +If the library is hosted at a git repository, e.g. https://github.com/{{gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} then install it via: ```shell - npm install {{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save + npm install {{gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save ``` ### For browser @@ -167,7 +167,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}.{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}.{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Javascript/api_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript/api_doc.mustache index b934e0042d1e..05a9d1e042c8 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/api_doc.mustache @@ -1,12 +1,12 @@ # {{moduleName}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{operationId}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -94,7 +94,7 @@ apiInstance.{{{operationId}}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/- Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Javascript/api_test.mustache b/modules/openapi-generator/src/main/resources/Javascript/api_test.mustache index 1107702d3fa5..398e3041a718 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/api_test.mustache @@ -2,10 +2,10 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. - define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], factory); + define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index')); + factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index')); } else { // Browser globals (root is window) factory(root.expect, root.{{moduleName}}); diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache index 35325e5276df..de2134ade06d 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache @@ -4,7 +4,7 @@ import superagent from "superagent"; import querystring from "querystring"; {{#emitJSDoc}}/** -* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient +* @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient * @version {{projectVersion}} */ @@ -12,7 +12,7 @@ import querystring from "querystring"; * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an * application to use this class directly - the *Api and model classes provide the public API for the service. The * contents of this file should be regarded as internal but are documented for completeness. -* @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient +* @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient * @class */{{/emitJSDoc}} class ApiClient { @@ -53,7 +53,7 @@ class ApiClient { * @default {} */{{/emitJSDoc}} this.defaultHeaders = { - 'User-Agent': '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{projectVersion}}/Javascript{{/httpUserAgent}}' + 'User-Agent': '{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{projectVersion}}/Javascript{{/httpUserAgent}}' }; /** @@ -264,7 +264,7 @@ class ApiClient { {{#emitJSDoc}}/** * Builds a string representation of an array-type actual parameter, according to the given collection format. * @param {Array} param An array parameter. - * @param {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. + * @param {module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns * param as is if collectionFormat is multi. */{{/emitJSDoc}} @@ -375,7 +375,7 @@ class ApiClient { {{^usePromises}} /** * Callback function to receive the result of the operation. - * @callback module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient~callApiCallback + * @callback module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient~callApiCallback * @param {String} error Error message, if any. * @param data The data returned by the service call. * @param {String} response The complete HTTP response. @@ -400,7 +400,7 @@ class ApiClient { * constructor for a complex type. * @param {String} apiBasePath base path defined in the operation/path level to override the default one {{^usePromises}} - * @param {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient~callApiCallback} callback The callback function. + * @param {module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient~callApiCallback} callback The callback function. {{/usePromises}} * @returns {{#usePromises}}{Promise} A {@link https://www.promisejs.org/|Promise} object{{/usePromises}}{{^usePromises}}{Object} The SuperAgent request object{{/usePromises}}. */ @@ -755,7 +755,7 @@ ApiClient.CollectionFormatEnum = { {{#emitJSDoc}}/** * The default API client implementation. -* @type {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient} +* @type {module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient} */{{/emitJSDoc}} ApiClient.instance = new ApiClient(); export default ApiClient; diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache index dd4a6721a2d7..0ac4e62d2f53 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache @@ -2,7 +2,7 @@ {{moduleName}} - JavaScript client for {{projectName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -64,11 +64,11 @@ npm run build #### git -If the library is hosted at a git repository, e.g.https://github.com/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} +If the library is hosted at a git repository, e.g.https://github.com/{{gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} then install it via: ```shell - npm install {{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save + npm install {{gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save ``` ### For browser @@ -181,7 +181,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}.{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}.{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/api_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/api_doc.mustache index ab08ff8495b6..0a68747b73d7 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/api_doc.mustache @@ -1,12 +1,12 @@ # {{moduleName}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{operationId}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -92,7 +92,7 @@ apiInstance.{{{operationId}}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/- {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/api_test.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/api_test.mustache index 1107702d3fa5..398e3041a718 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/api_test.mustache @@ -2,10 +2,10 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. - define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], factory); + define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index')); + factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index')); } else { // Browser globals (root is window) factory(root.expect, root.{{moduleName}}); diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/index.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/index.mustache index 36b8a2032d14..56213101a340 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/index.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/index.mustache @@ -1,17 +1,17 @@ {{>licenseInfo}} import ApiClient from './ApiClient'; -{{#models}}import {{#model}}{{classFilename}}{{/model}} from './{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'; -{{/models}}{{#apiInfo}}{{#apis}}import {{importPath}} from './{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'; +{{#models}}import {{#model}}{{classFilename}}{{/model}} from './{{#modelPackage}}{{.}}/{{/modelPackage}}{{importPath}}'; +{{/models}}{{#apiInfo}}{{#apis}}import {{importPath}} from './{{#apiPackage}}{{.}}/{{/apiPackage}}{{importPath}}'; {{/apis}}{{/apiInfo}} {{#emitJSDoc}}/**{{#projectDescription}} -* {{projectDescription}}.
{{/projectDescription}} +* {{.}}.
{{/projectDescription}} * The index module provides access to constructors for all the classes which comprise the public API. *

* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: *

-* var {{moduleName}} = require('{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'); // See note below*.
+* var {{moduleName}} = require('{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'); // See note below*.
 * var xxxSvc = new {{moduleName}}.XxxApi(); // Allocate the API class we're going to use.
 * var yyyModel = new {{moduleName}}.Yyy(); // Construct a model instance.
 * yyyModel.someProperty = 'someValue';
@@ -19,7 +19,7 @@ import ApiClient from './ApiClient';
 * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
 * ...
 * 
-* *NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], function(){...}) +* *NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], function(){...}) * and put the application logic within the callback function. *

*

@@ -33,7 +33,7 @@ import ApiClient from './ApiClient'; * ... * *

-* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index +* @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}index * @version {{projectVersion}} */{{/emitJSDoc}} export { diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/licenseInfo.mustache index 40cac6d4a3c1..2a386a24226d 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/model_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/model_doc.mustache index 04ab6f949ac9..fc21ae6e9f1f 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/model_doc.mustache @@ -11,7 +11,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/vars}} {{#vars}}{{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/model_test.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/model_test.mustache index 8769cfeb8708..ec7842a6722d 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/model_test.mustache @@ -2,10 +2,10 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. - define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], factory); + define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index')); + factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index')); } else { // Browser globals (root is window) factory(root.expect, root.{{moduleName}}); diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/package.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/package.mustache index c59eff4b0333..06b3a11c266f 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/package.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/package.mustache @@ -3,7 +3,7 @@ "version": "{{{projectVersion}}}", "description": "{{{projectDescription}}}", "license": "{{licenseName}}", - "main": "dist{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js", + "main": "dist{{#invokerPackage}}/{{.}}{{/invokerPackage}}/index.js", "scripts": { "build": "babel src -d dist", "prepare": "npm run build", diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache index cc82b99becbd..c367e4b82010 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache @@ -1,17 +1,17 @@ {{#models}}{{#model}}{{#emitJSDoc}}/** * The {{classname}} model module. - * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} + * @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}} * @version {{projectVersion}} */{{/emitJSDoc}} class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}extends Array {{/vendorExtensions.x-is-array}}{{/parentModel}}{{/parent}}{ {{#emitJSDoc}}/** * Constructs a new {{classname}}.{{#description}} - * {{description}}{{/description}} - * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{#useInheritance}}{{#parent}} - * @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-is-array}}Array{{/vendorExtensions.x-is-array}}{{#vendorExtensions.x-is-map}}Object{{/vendorExtensions.x-is-map}}{{/parentModel}}{{/parent}}{{#interfaces}} - * @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} - * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}} + * {{.}}{{/description}} + * @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}}{{#useInheritance}}{{#parent}} + * @extends {{#parentModel}}module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-is-array}}Array{{/vendorExtensions.x-is-array}}{{#vendorExtensions.x-is-map}}Object{{/vendorExtensions.x-is-map}}{{/parentModel}}{{/parent}}{{#interfaces}} + * @implements module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} + * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{{description}}}{{/vendorExtensions.x-all-required}} */{{/emitJSDoc}} constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}} super(); @@ -55,9 +55,9 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e } {{#emitModelMethods}}{{#vars}}{{#emitJSDoc}}/**{{#description}} - * Returns {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} + * Returns {{{.}}}{{/description}}{{#minimum}} + * minimum: {{.}}{{/minimum}}{{#maximum}} + * maximum: {{.}}{{/maximum}} * @return {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> */{{/emitJSDoc}} {{getter}}() { @@ -65,8 +65,8 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e } {{#emitJSDoc}}/**{{#description}} - * Sets {{{description}}}{{/description}} - * @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{description}}}{{/description}} + * Sets {{{.}}}{{/description}} + * @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{.}}}{{/description}} */{{/emitJSDoc}} {{setter}}({{name}}) { this['{{baseName}}'] = {{name}}; @@ -75,21 +75,21 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e } {{#vars}}{{#emitJSDoc}}/**{{#description}} - * {{{description}}}{{/description}} + * {{{.}}}{{/description}} * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} + * @default {{{.}}}{{/defaultValue}} */{{/emitJSDoc}} -{{classname}}.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; +{{classname}}.prototype['{{baseName}}'] = {{{defaultValue}}}{{^defaultValue}}undefined{{/defaultValue}}; {{/vars}} {{#useInheritance}}{{#interfaceModels}}// Implement {{classname}} interface: {{#allVars}}{{#emitJSDoc}}/**{{#description}} - * {{{description}}}{{/description}} + * {{{.}}}{{/description}} * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} + * @default {{{.}}}{{/defaultValue}} */{{/emitJSDoc}} -{{classname}}.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; +{{classname}}.prototype['{{baseName}}'] = {{{defaultValue}}}{{^defaultValue}}undefined{{/defaultValue}}; {{/allVars}}{{/interfaceModels}}{{/useInheritance}} {{#vars}}{{#isEnum}}{{^isContainer}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100755 --- a/modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/Javascript/index.mustache b/modules/openapi-generator/src/main/resources/Javascript/index.mustache index d6ca3cff7042..1286f772bf94 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/index.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/index.mustache @@ -2,21 +2,21 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient'{{#models}}, '{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'{{/models}}{{#apiInfo}}{{#apis}}, '{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'{{/apis}}{{/apiInfo}}], factory); + define(['{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient'{{#models}}, '{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{importPath}}'{{/models}}{{#apiInfo}}{{#apis}}, '{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#apiPackage}}{{.}}/{{/apiPackage}}{{importPath}}'{{/apis}}{{/apiInfo}}], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'){{#models}}, require('./{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'){{/models}}{{#apiInfo}}{{#apis}}, require('./{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'){{/apis}}{{/apiInfo}}); + module.exports = factory(require('./ApiClient'){{#models}}, require('./{{#modelPackage}}{{.}}/{{/modelPackage}}{{importPath}}'){{/models}}{{#apiInfo}}{{#apis}}, require('./{{#apiPackage}}{{.}}/{{/apiPackage}}{{importPath}}'){{/apis}}{{/apiInfo}}); } }(function(ApiClient{{#models}}{{#model}}, {{classFilename}}{{/model}}{{/models}}{{#apiInfo}}{{#apis}}, {{importPath}}{{/apis}}{{/apiInfo}}) { 'use strict'; {{#emitJSDoc}} /**{{#projectDescription}} - * {{projectDescription}}.
{{/projectDescription}} + * {{.}}.
{{/projectDescription}} * The index module provides access to constructors for all the classes which comprise the public API. *

* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: *

-   * var {{moduleName}} = require('{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'); // See note below*.
+   * var {{moduleName}} = require('{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'); // See note below*.
    * var xxxSvc = new {{moduleName}}.XxxApi(); // Allocate the API class we're going to use.
    * var yyyModel = new {{moduleName}}.Yyy(); // Construct a model instance.
    * yyyModel.someProperty = 'someValue';
@@ -24,7 +24,7 @@
    * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
    * ...
    * 
- * *NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], function(){...}) + * *NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], function(){...}) * and put the application logic within the callback function. *

*

@@ -38,7 +38,7 @@ * ... * *

- * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index + * @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}index * @version {{projectVersion}} */{{/emitJSDoc}} {{=< >=}} var exports = {<#emitJSDoc> diff --git a/modules/openapi-generator/src/main/resources/Javascript/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Javascript/licenseInfo.mustache index 4a27ba7c5cd1..571d22d4a65e 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/licenseInfo.mustache @@ -3,10 +3,10 @@ * {{{appDescription}}} * {{#version}} - * The version of the OpenAPI document: {{{version}}} + * The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/modules/openapi-generator/src/main/resources/Javascript/model.mustache b/modules/openapi-generator/src/main/resources/Javascript/model.mustache index 95f2b2df81dd..2621ddcba652 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/model.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/model.mustache @@ -2,7 +2,7 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient'{{#imports}}, '{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{import}}'{{/imports}}], factory); + define(['{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient'{{#imports}}, '{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{import}}'{{/imports}}], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'){{#imports}}, require('./{{import}}'){{/imports}}); diff --git a/modules/openapi-generator/src/main/resources/Javascript/model_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript/model_doc.mustache index 04ab6f949ac9..fc21ae6e9f1f 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/model_doc.mustache @@ -11,7 +11,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/vars}} {{#vars}}{{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/model_test.mustache b/modules/openapi-generator/src/main/resources/Javascript/model_test.mustache index 0680e194f15b..53071a6ce09b 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/model_test.mustache @@ -2,10 +2,10 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. - define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], factory); + define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index')); + factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index')); } else { // Browser globals (root is window) factory(root.expect, root.{{moduleName}}); diff --git a/modules/openapi-generator/src/main/resources/Javascript/package.mustache b/modules/openapi-generator/src/main/resources/Javascript/package.mustache index 2fe23d57d745..50f02589eff5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/package.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/package.mustache @@ -3,7 +3,7 @@ "version": "{{{projectVersion}}}", "description": "{{{projectDescription}}}", "license": "{{licenseName}}", - "main": "{{sourceFolder}}{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js", + "main": "{{sourceFolder}}{{#invokerPackage}}/{{.}}{{/invokerPackage}}/index.js", "scripts": { "test": "mocha --recursive" }, diff --git a/modules/openapi-generator/src/main/resources/Javascript/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/Javascript/partial_model_generic.mustache index e6fcc62c9e3c..6da2a98af9dc 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/partial_model_generic.mustache @@ -2,18 +2,18 @@ {{#emitJSDoc}} /** * The {{classname}} model module. - * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} + * @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}} * @version {{projectVersion}} */ /** * Constructs a new {{classname}}.{{#description}} - * {{description}}{{/description}} - * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} + * {{.}}{{/description}} + * @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}} * @class{{#useInheritance}}{{#parent}} - * @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-is-array}}Array{{/vendorExtensions.x-is-array}}{{#vendorExtensions.x-is-map}}Object{{/vendorExtensions.x-is-map}}{{/parentModel}}{{/parent}}{{#interfaces}} - * @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} - * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}} + * @extends {{#parentModel}}module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-is-array}}Array{{/vendorExtensions.x-is-array}}{{#vendorExtensions.x-is-map}}Object{{/vendorExtensions.x-is-map}}{{/parentModel}}{{/parent}}{{#interfaces}} + * @implements module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} + * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{{description}}}{{/vendorExtensions.x-all-required}} */ {{/emitJSDoc}} var exports = function({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { @@ -97,29 +97,29 @@ {{#vars}} {{#emitJSDoc}} /**{{#description}} - * {{{description}}}{{/description}} + * {{{.}}}{{/description}} * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} + * @default {{{.}}}{{/defaultValue}} */ {{/emitJSDoc}} - exports.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; + exports.prototype['{{baseName}}'] = {{{defaultValue}}}{{^defaultValue}}undefined{{/defaultValue}}; {{/vars}}{{#useInheritance}}{{#interfaceModels}} // Implement {{classname}} interface:{{#allVars}} {{#emitJSDoc}} /**{{#description}} - * {{{description}}}{{/description}} + * {{{.}}}{{/description}} * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} + * @default {{{.}}}{{/defaultValue}} */ {{/emitJSDoc}} -exports.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; +exports.prototype['{{baseName}}'] = {{{defaultValue}}}{{^defaultValue}}undefined{{/defaultValue}}; {{/allVars}}{{/interfaceModels}}{{/useInheritance}} {{#emitModelMethods}}{{#vars}} {{#emitJSDoc}} /**{{#description}} - * Returns {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} + * Returns {{{.}}}{{/description}}{{#minimum}} + * minimum: {{.}}{{/minimum}}{{#maximum}} + * maximum: {{.}}{{/maximum}} * @return {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> */ {{/emitJSDoc}} @@ -129,8 +129,8 @@ exports.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaul {{#emitJSDoc}} /**{{#description}} - * Sets {{{description}}}{{/description}} - * @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{description}}}{{/description}} + * Sets {{{.}}}{{/description}} + * @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{.}}}{{/description}} */ {{/emitJSDoc}} exports.prototype.{{setter}} = function({{name}}) { diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index a213327b3f7a..df636589cd59 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -55,6 +55,7 @@ org.openapitools.codegen.languages.HaskellServantCodegen org.openapitools.codegen.languages.JavaClientCodegen org.openapitools.codegen.languages.JavaCXFClientCodegen org.openapitools.codegen.languages.JavaInflectorServerCodegen +org.openapitools.codegen.languages.JavaMicronautClientCodegen org.openapitools.codegen.languages.JavaMSF4JServerCodegen org.openapitools.codegen.languages.JavaPKMSTServerCodegen org.openapitools.codegen.languages.JavaPlayFrameworkCodegen @@ -93,6 +94,7 @@ org.openapitools.codegen.languages.PhpSlim4ServerCodegen org.openapitools.codegen.languages.PhpSilexServerCodegen org.openapitools.codegen.languages.PhpSymfonyServerCodegen org.openapitools.codegen.languages.PhpMezzioPathHandlerServerCodegen +org.openapitools.codegen.languages.PhpDataTransferClientCodegen org.openapitools.codegen.languages.PowerShellClientCodegen org.openapitools.codegen.languages.ProtobufSchemaCodegen org.openapitools.codegen.languages.PythonLegacyClientCodegen diff --git a/modules/openapi-generator/src/main/resources/android/README.mustache b/modules/openapi-generator/src/main/resources/android/README.mustache index 0f0ef9d155e4..d61a46e981d9 100644 --- a/modules/openapi-generator/src/main/resources/android/README.mustache +++ b/modules/openapi-generator/src/main/resources/android/README.mustache @@ -68,7 +68,7 @@ public class {{{classname}}}Example { {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} System.out.println(result);{{/returnType}} } catch (ApiException e) { System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); @@ -85,7 +85,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/android/api.mustache b/modules/openapi-generator/src/main/resources/android/api.mustache index 188c52253c6d..6a82dd69f09f 100644 --- a/modules/openapi-generator/src/main/resources/android/api.mustache +++ b/modules/openapi-generator/src/main/resources/android/api.mustache @@ -46,9 +46,9 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} * @param {{paramName}} {{description}} -{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} +{{/allParams}} * @return {{{returnType}}}{{^returnType}}void{{/returnType}} */ - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}} {{#required}} @@ -70,7 +70,7 @@ public class {{classname}} { Map localVarFormParams = new HashMap(); {{#queryParams}} - localVarQueryParams.addAll(ApiInvoker.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarQueryParams.addAll(ApiInvoker.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}} diff --git a/modules/openapi-generator/src/main/resources/android/apiInvoker.mustache b/modules/openapi-generator/src/main/resources/android/apiInvoker.mustache index e77cc60b8ca8..ffa99306de81 100644 --- a/modules/openapi-generator/src/main/resources/android/apiInvoker.mustache +++ b/modules/openapi-generator/src/main/resources/android/apiInvoker.mustache @@ -84,7 +84,7 @@ public class ApiInvoker { DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); // Set default User-Agent. - setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/android{{/httpUserAgent}}"); + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/android{{/httpUserAgent}}"); } public static void setUserAgent(String userAgent) { diff --git a/modules/openapi-generator/src/main/resources/android/api_doc.mustache b/modules/openapi-generator/src/main/resources/android/api_doc.mustache index d7ea617e2fb6..be7bb2701cb0 100644 --- a/modules/openapi-generator/src/main/resources/android/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/android/api_doc.mustache @@ -1,12 +1,12 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{operationId}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -31,7 +31,7 @@ Method | HTTP request | Description {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} System.out.println(result);{{/returnType}} } catch (ApiException e) { System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); @@ -44,7 +44,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/android/build.mustache b/modules/openapi-generator/src/main/resources/android/build.mustache index 4d465c7b9a82..1a5ba2185eaf 100644 --- a/modules/openapi-generator/src/main/resources/android/build.mustache +++ b/modules/openapi-generator/src/main/resources/android/build.mustache @@ -10,7 +10,7 @@ buildscript { } dependencies { {{#androidGradleVersion}} - classpath 'com.android.tools.build:gradle:{{{androidGradleVersion}}}' + classpath 'com.android.tools.build:gradle:{{{.}}}' {{/androidGradleVersion}} {{^androidGradleVersion}} classpath 'com.android.tools.build:gradle:2.3.+' @@ -35,13 +35,13 @@ apply plugin: 'com.github.dcendents.android-maven' android { {{#androidSdkVersion}} - compileSdkVersion {{{androidSdkVersion}}} + compileSdkVersion {{{.}}} {{/androidSdkVersion}} {{^androidSdkVersion}} compileSdkVersion 25 {{/androidSdkVersion}} {{#androidBuildToolsVersion}} - buildToolsVersion '{{{androidBuildToolsVersion}}}' + buildToolsVersion '{{{.}}}' {{/androidBuildToolsVersion}} {{^androidBuildToolsVersion}} buildToolsVersion '25.0.2' @@ -50,7 +50,7 @@ android { defaultConfig { minSdkVersion 14 {{#androidSdkVersion}} - targetSdkVersion {{{androidSdkVersion}}} + targetSdkVersion {{{.}}} {{/androidSdkVersion}} {{^androidSdkVersion}} targetSdkVersion 25 diff --git a/modules/openapi-generator/src/main/resources/android/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/android/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100755 --- a/modules/openapi-generator/src/main/resources/android/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/android/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/android/libraries/volley/api.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/api.mustache index fdae8995f1f6..51f5cd840b4c 100644 --- a/modules/openapi-generator/src/main/resources/android/libraries/volley/api.mustache +++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/api.mustache @@ -53,9 +53,9 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} * @param {{paramName}} {{description}} -{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} +{{/allParams}} * @return {{{returnType}}}{{^returnType}}void{{/returnType}} */ - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws TimeoutException, ExecutionException, InterruptedException, ApiException { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}} {{#required}} @@ -77,7 +77,7 @@ public class {{classname}} { // form params Map formParams = new HashMap(); {{#queryParams}} - queryParams.addAll(ApiInvoker.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + queryParams.addAll(ApiInvoker.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}} headerParams.put("{{baseName}}", ApiInvoker.parameterToString({{paramName}})); @@ -146,7 +146,7 @@ public class {{classname}} { * {{notes}} {{#allParams}} * @param {{paramName}} {{description}}{{/allParams}} */ - public void {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{#-last}}, {{/-last}}{{/allParams}}final Response.Listener<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}String{{/returnType}}> responseListener, final Response.ErrorListener errorListener) { + public void {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{#-last}}, {{/-last}}{{/allParams}}final Response.Listener<{{{returnType}}}{{^returnType}}String{{/returnType}}> responseListener, final Response.ErrorListener errorListener) { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}} @@ -170,7 +170,7 @@ public class {{classname}} { Map formParams = new HashMap(); {{#queryParams}} - queryParams.addAll(ApiInvoker.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + queryParams.addAll(ApiInvoker.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}} diff --git a/modules/openapi-generator/src/main/resources/android/libraries/volley/apiInvoker.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/apiInvoker.mustache index defb844693ea..db0fcd2e6295 100644 --- a/modules/openapi-generator/src/main/resources/android/libraries/volley/apiInvoker.mustache +++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/apiInvoker.mustache @@ -188,7 +188,7 @@ public class ApiInvoker { public static void initializeInstance(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) { INSTANCE = new ApiInvoker(cache, network, threadPoolSize, delivery, connectionTimeout); - setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/android{{/httpUserAgent}}"); + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/android{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). INSTANCE.authentications = new HashMap(); diff --git a/modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100644 --- a/modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/android/libraries/volley/model.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/model.mustache index 110c218e45a1..5778c739af0a 100644 --- a/modules/openapi-generator/src/main/resources/android/libraries/volley/model.mustache +++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/model.mustache @@ -13,11 +13,11 @@ import java.io.Serializable; {{#model}} {{#description}} /** - * {{description}} + * {{.}} **/ {{/description}} @ApiModel(description = "{{{description}}}") -public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#serializableModel}}implements Serializable {{/serializableModel}}{ +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#serializableModel}}implements Serializable {{/serializableModel}}{ {{#vars}}{{#isEnum}} public enum {{datatypeWithEnum}} { {{#allowableValues}}{{#values}} {{.}}, {{/values}}{{/allowableValues}} @@ -29,9 +29,9 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#seriali {{#vars}} /**{{#description}} - * {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} + * {{{.}}}{{/description}}{{#minimum}} + * minimum: {{.}}{{/minimum}}{{#maximum}} + * maximum: {{.}}{{/maximum}} **/ @ApiModelProperty({{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") public {{{datatypeWithEnum}}} {{getter}}() { diff --git a/modules/openapi-generator/src/main/resources/android/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/android/licenseInfo.mustache index 9866f297a4d7..be193d0c4fe8 100644 --- a/modules/openapi-generator/src/main/resources/android/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/android/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/android/model.mustache b/modules/openapi-generator/src/main/resources/android/model.mustache index 498409cfb23d..35949bc59814 100644 --- a/modules/openapi-generator/src/main/resources/android/model.mustache +++ b/modules/openapi-generator/src/main/resources/android/model.mustache @@ -9,10 +9,10 @@ import com.google.gson.annotations.SerializedName; {{#model}}{{#description}} /** - * {{description}} + * {{.}} **/{{/description}} @ApiModel(description = "{{{description}}}") -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} { {{#vars}}{{#isEnum}} public enum {{datatypeWithEnum}} { {{#allowableValues}}{{#values}} {{.}}, {{/values}}{{/allowableValues}} @@ -24,9 +24,9 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { {{#vars}} /**{{#description}} - * {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} + * {{{.}}}{{/description}}{{#minimum}} + * minimum: {{.}}{{/minimum}}{{#maximum}} + * maximum: {{.}}{{/maximum}} **/ @ApiModelProperty({{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") public {{{datatypeWithEnum}}} {{getter}}() { diff --git a/modules/openapi-generator/src/main/resources/apex/README_ant.mustache b/modules/openapi-generator/src/main/resources/apex/README_ant.mustache index b41000afa5f0..a51ef6a12399 100644 --- a/modules/openapi-generator/src/main/resources/apex/README_ant.mustache +++ b/modules/openapi-generator/src/main/resources/apex/README_ant.mustache @@ -2,7 +2,7 @@ {{#appDescription}} -{{{appDescription}}} +{{{.}}} {{/appDescription}} ## Requirements @@ -52,7 +52,7 @@ For more information, see params = new Map{ try { // cross your fingers - {{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{{operationId}}}({{#hasParams}}params{{/hasParams}}); + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{{operationId}}}({{#hasParams}}params{{/hasParams}}); {{#returnType}} System.debug(result); {{/returnType}} @@ -146,7 +146,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/apex/README_sfdx.mustache b/modules/openapi-generator/src/main/resources/apex/README_sfdx.mustache index 4058dbc786b7..27e446e928e5 100644 --- a/modules/openapi-generator/src/main/resources/apex/README_sfdx.mustache +++ b/modules/openapi-generator/src/main/resources/apex/README_sfdx.mustache @@ -2,7 +2,7 @@ {{#appDescription}} -{{{appDescription}}} +{{{.}}} {{/appDescription}} ## Requirements @@ -63,7 +63,7 @@ Map params = new Map{ try { // cross your fingers - {{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{{operationId}}}({{#hasParams}}params{{/hasParams}}); + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{{operationId}}}({{#hasParams}}params{{/hasParams}}); {{#returnType}} System.debug(result); {{/returnType}} @@ -78,7 +78,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/apex/api.mustache b/modules/openapi-generator/src/main/resources/apex/api.mustache index 3683b7cf5b1f..eff84988e223 100644 --- a/modules/openapi-generator/src/main/resources/apex/api.mustache +++ b/modules/openapi-generator/src/main/resources/apex/api.mustache @@ -23,11 +23,11 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} - * @return {{{returnType}}} + * @return {{{.}}} {{/returnType}} * @throws OAS.ApiException if fails to make API call */ - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#hasParams}}Map params{{/hasParams}}) { + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#hasParams}}Map params{{/hasParams}}) { {{#allParams}} {{#required}} client.assertNotNull(params.get('{{paramName}}'), '{{paramName}}'); @@ -73,7 +73,7 @@ public class {{classname}} { {{/isArray}} {{/formParams}} - {{#returnType}}return ({{{returnType}}}) {{/returnType}}client.invoke( + {{#returnType}}return ({{{.}}}) {{/returnType}}client.invoke( '{{httpMethod}}', '{{path}}',{{#bodyParam}} ({{{dataType}}}) params.get('{{paramName}}'){{/bodyParam}}{{^bodyParam}} ''{{/bodyParam}}, query, form, @@ -106,7 +106,7 @@ public class {{classname}} { new List(), {{/hasAuthMethods}} {{#returnType}} - {{{returnType}}}.class + {{{.}}}.class {{/returnType}} {{^returnType}} null diff --git a/modules/openapi-generator/src/main/resources/apex/api_doc.mustache b/modules/openapi-generator/src/main/resources/apex/api_doc.mustache index 2b5bb7234155..39a1770f24c8 100644 --- a/modules/openapi-generator/src/main/resources/apex/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/apex/api_doc.mustache @@ -1,12 +1,12 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{operationId}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -53,7 +53,7 @@ Map params = new Map{ try { // cross your fingers - {{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{{operationId}}}({{#hasParams}}params{{/hasParams}}); + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{{operationId}}}({{#hasParams}}params{{/hasParams}}); {{#returnType}} System.debug(result); {{/returnType}} @@ -67,7 +67,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100644 --- a/modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/apex/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/apex/licenseInfo.mustache index 3f52a36757f1..0ef467e83212 100644 --- a/modules/openapi-generator/src/main/resources/apex/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/apex/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by the OAS code generator program. * https://github.com/OpenAPITools/openapi-generator diff --git a/modules/openapi-generator/src/main/resources/apex/modelEnum.mustache b/modules/openapi-generator/src/main/resources/apex/modelEnum.mustache index ad4d173fe5da..909b57af16f5 100644 --- a/modules/openapi-generator/src/main/resources/apex/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/apex/modelEnum.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} {{name}}{{^-last}},{{/-last}} diff --git a/modules/openapi-generator/src/main/resources/apex/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/apex/modelInnerEnum.mustache index c21dd1e3f0d5..d0b3c7a08a30 100644 --- a/modules/openapi-generator/src/main/resources/apex/modelInnerEnum.mustache +++ b/modules/openapi-generator/src/main/resources/apex/modelInnerEnum.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} {{{name}}}{{^-last}},{{/-last}} diff --git a/modules/openapi-generator/src/main/resources/apex/package.mustache b/modules/openapi-generator/src/main/resources/apex/package.mustache index cee192083836..ec3d92d25102 100644 --- a/modules/openapi-generator/src/main/resources/apex/package.mustache +++ b/modules/openapi-generator/src/main/resources/apex/package.mustache @@ -2,7 +2,7 @@ {{appName}} API Client Client library for calling the {{appName}} API.{{#appDescription}} -{{{appDescription}}}{{/appDescription}} +{{{.}}}{{/appDescription}} Generated with OAS Codegen (github.com/OAS-api/OAS-codegen) {{#apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/apex/pojo.mustache b/modules/openapi-generator/src/main/resources/apex/pojo.mustache index c3a5126aeb67..bb21f63f5482 100644 --- a/modules/openapi-generator/src/main/resources/apex/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/apex/pojo.mustache @@ -1,7 +1,7 @@ /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + * {{description}}{{^description}}{{classname}}{{/description}} */{{>additionalModelTypeAnnotations}} -public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{#interfaces}}{{#-first}} implements {{/-first}}{{^-first}}, {{/-first}}{{.}}{{/interfaces}} { +public class {{classname}}{{#parent}} extends {{{.}}}{{/parent}}{{#interfaces}}{{#-first}} implements {{/-first}}{{^-first}}, {{/-first}}{{.}}{{/interfaces}} { {{#vars}} {{#isEnum}} {{^isContainer}} @@ -17,16 +17,16 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{#interfac {{/items.isEnum}} /** {{#description}} - * {{{description}}} + * {{{.}}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} */ diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache index fcab76298ef1..48d810d038ac 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache @@ -1,12 +1,12 @@ = {{{appName}}} -{{#headerAttributes}} +{{#headerAttributes}} {{infoEmail}} -{{#version}}{{{version}}}{{/version}} +{{{version}}} :toc: left :numbered: :toclevels: 3 :source-highlighter: highlightjs -:keywords: openapi, rest, {{appName}} +:keywords: openapi, rest, {{appName}} :specDir: {{specDir}} :snippetDir: {{snippetDir}} :generator-template: v1 2019-12-20 @@ -59,13 +59,13 @@ Operation Id:: {{nickname}} {{/useMethodAndPath}} {{^useMethodAndPath}} ==== {{nickname}} - + `{{httpMethod}} {{path}}` {{/useMethodAndPath}} {{{summary}}} -===== Description +===== Description {{{notes}}} @@ -81,7 +81,7 @@ Operation Id:: {{nickname}} {{/hasReference}} {{^hasReference}} -{{#returnType}}<<{{returnType}}>>{{/returnType}} +{{#returnType}}<<{{.}}>>{{/returnType}} {{^returnType}}-{{/returnType}} {{/hasReference}} @@ -97,8 +97,8 @@ Operation Id:: {{nickname}} .http response codes [cols="2,3,1"] -|=== -| Code | Message | Datatype +|=== +| Code | Message | Datatype {{#responses}} @@ -107,7 +107,7 @@ Operation Id:: {{nickname}} | {{^simpleType}}{{dataType}}[<<{{baseType}}>>]{{/simpleType}} {{#simpleType}}<<{{dataType}}>>{{/simpleType}} {{/responses}} -|=== +|=== {{^skipExamples}} ===== Samples diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache index c5f93d6afdbb..604d7d14c4a6 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache @@ -11,13 +11,13 @@ [.fields-{{classname}}] [cols="2,1,2,4,1"] -|=== +|=== | Field Name| Required| Type| Description| Format {{#vars}} -| {{baseName}} -| {{#required}}X{{/required}} -| {{dataType}} {{#isContainer}} of <<{{complexType}}>>{{/isContainer}} +| {{baseName}} +| {{#required}}X{{/required}} +| {{dataType}} {{#isContainer}} of <<{{complexType}}>>{{/isContainer}} | {{description}} | {{{dataFormat}}} {{#isEnum}}_Enum:_ {{#_enum}}{{this}}, {{/_enum}}{{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache index 563e7976fdfc..df96a59769f4 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache @@ -1,5 +1,5 @@ -| {{baseName}} -| {{description}} {{#baseType}}<<{{baseType}}>>{{/baseType}} -| {{^required}}-{{/required}}{{#required}}X{{/required}} -| {{defaultValue}} -| {{{pattern}}} +| {{baseName}} +| {{description}} {{#baseType}}<<{{.}}>>{{/baseType}} +| {{^required}}-{{/required}}{{#required}}X{{/required}} +| {{defaultValue}} +| {{{pattern}}} diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/params.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/params.mustache index 7307bf155e83..76409161eff1 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/params.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/params.mustache @@ -9,13 +9,13 @@ {{#useTableTitles}} .Path Parameters {{/useTableTitles}} -|=== +|=== |Name| Description| Required| Default| Pattern {{#pathParams}} {{>param}} {{/pathParams}} -|=== +|=== {{/hasPathParams}} {{#hasBodyParam}} @@ -27,13 +27,13 @@ {{#useTableTitles}} .Body Parameter {{/useTableTitles}} -|=== +|=== |Name| Description| Required| Default| Pattern {{#bodyParams}} {{>param}} {{/bodyParams}} -|=== +|=== {{/hasBodyParam}} {{#hasFormParams}} @@ -45,13 +45,13 @@ {{#useTableTitles}} .Form Parameters {{/useTableTitles}} -|=== +|=== |Name| Description| Required| Default| Pattern {{#formParams}} {{>param}} {{/formParams}} -|=== +|=== {{/hasFormParams}} {{#hasHeaderParams}} @@ -63,13 +63,13 @@ {{#useTableTitles}} .Header Parameters {{/useTableTitles}} -|=== +|=== |Name| Description| Required| Default| Pattern {{#headerParams}} {{>param}} {{/headerParams}} -|=== +|=== {{/hasHeaderParams}} {{#hasQueryParams}} @@ -81,11 +81,11 @@ {{#useTableTitles}} .Query Parameters {{/useTableTitles}} -|=== +|=== |Name| Description| Required| Default| Pattern {{#queryParams}} {{>param}} {{/queryParams}} -|=== +|=== {{/hasQueryParams}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Filters/GeneratePathParamsValidationFilter.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Filters/GeneratePathParamsValidationFilter.mustache index d857a4a0f960..e990e87db3b4 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Filters/GeneratePathParamsValidationFilter.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Filters/GeneratePathParamsValidationFilter.mustache @@ -94,4 +94,3 @@ namespace {{packageName}}.Filters } } } - diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Formatters/InputFormatterStream.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Formatters/InputFormatterStream.mustache index f1a002ded67c..e24d0a237a11 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Formatters/InputFormatterStream.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Formatters/InputFormatterStream.mustache @@ -13,7 +13,7 @@ namespace {{packageName}}.Formatters SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } - + protected override bool CanReadType(Type type) { if (type == typeof(Stream)) diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Program.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Program.mustache index 7de837799830..75b5d9d0675a 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Program.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Program.mustache @@ -24,8 +24,8 @@ namespace {{packageName}} /// Webhost public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) - .UseStartup() - .UseUrls("http://0.0.0.0:{{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}}/") + .UseStartup() + .UseUrls("http://0.0.0.0:{{serverPort}}{{^serverPort}}8080{{/serverPort}}/") .Build(); } } diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Project.csproj.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Project.csproj.mustache index 6732557feeb8..c67bdaab8786 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Project.csproj.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Project.csproj.mustache @@ -1,6 +1,6 @@ - {{^packageDescription}}{{packageName}}{{/packageDescription}}{{packageDescription}} + {{packageDescription}}{{^packageDescription}}{{packageName}}{{/packageDescription}} {{packageCopyright}} {{packageAuthors}} netcoreapp2.0 diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/README.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/README.mustache index 37794bd48e04..eb041c5f9e85 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/README.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/README.mustache @@ -1,7 +1,7 @@ # {{packageName}} - ASP.NET Core 2.0 Server {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Run diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Startup.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Startup.mustache index 044ce0c80e07..fd0b75634c4b 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Startup.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Startup.mustache @@ -56,25 +56,25 @@ namespace {{packageName}} services .AddSwaggerGen(c => { - c.SwaggerDoc("{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", new Info + c.SwaggerDoc("{{{version}}}{{^version}}v1{{/version}}", new Info { - Version = "{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", - Title = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}", - Description = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core 2.0)", + Version = "{{{version}}}{{^version}}v1{{/version}}", + Title = "{{{appName}}}{{^appName}}{{packageName}}{{/appName}}", + Description = "{{{appName}}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core 2.0)", Contact = new Contact() { - Name = "{{#infoName}}{{{infoName}}}{{/infoName}}{{^infoName}}OpenAPI-Generator Contributors{{/infoName}}", - Url = "{{#infoUrl}}{{{infoUrl}}}{{/infoUrl}}{{^infoUrl}}https://github.com/openapitools/openapi-generator{{/infoUrl}}", - Email = "{{#infoEmail}}{{{infoEmail}}}{{/infoEmail}}" + Name = "{{{infoName}}}{{^infoName}}OpenAPI-Generator Contributors{{/infoName}}", + Url = "{{{infoUrl}}}{{^infoUrl}}https://github.com/openapitools/openapi-generator{{/infoUrl}}", + Email = "{{{infoEmail}}}" }, - TermsOfService = "{{#termsOfService}}{{{termsOfService}}}{{/termsOfService}}" + TermsOfService = "{{{termsOfService}}}" }); c.CustomSchemaIds(type => type.FriendlyId(true)); c.DescribeAllEnumsAsStrings(); c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); {{#basePathWithoutHost}} // Sets the basePath property in the Swagger document generated - c.DocumentFilter("{{{basePathWithoutHost}}}"); + c.DocumentFilter("{{{.}}}"); {{/basePathWithoutHost}} // Include DataAnnotation attributes on Controller Action parameters as Swagger validation rules (e.g required, pattern, ..) @@ -100,10 +100,10 @@ namespace {{packageName}} .UseSwaggerUI(c => { //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) - c.SwaggerEndpoint("/swagger/{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}/openapi.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}"); + c.SwaggerEndpoint("/swagger/{{{version}}}{{^version}}v1{{/version}}/openapi.json", "{{{appName}}}{{^appName}}{{packageName}}{{/appName}}"); //TODO: Or alternatively use the original Swagger contract that's included in the static files - // c.SwaggerEndpoint("/openapi-original.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} Original"); + // c.SwaggerEndpoint("/openapi-original.json", "{{{appName}}}{{^appName}}{{packageName}}{{/appName}} Original"); }){{/useSwashbuckle}}; if (_hostingEnv.IsDevelopment()) diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/controller.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/controller.mustache index a1b1701985d5..ac89e53c31a9 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/controller.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/controller.mustache @@ -16,13 +16,13 @@ namespace {{packageName}}.Controllers /// /// {{description}} /// {{#description}} - [Description("{{description}}")]{{/description}} + [Description("{{.}}")]{{/description}} public class {{classname}}Controller : Controller { {{#operation}} /// - /// {{#summary}}{{summary}}{{/summary}} + /// {{summary}} /// {{#notes}} - /// {{notes}}{{/notes}}{{#allParams}} + /// {{.}}{{/notes}}{{#allParams}} /// {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}}{{/allParams}}{{#responses}} /// {{message}}{{/responses}} [{{httpMethod}}] @@ -32,7 +32,7 @@ namespace {{packageName}}.Controllers {{/vendorExtensions.x-aspnetcore-consumes}} [ValidateModelState]{{#useSwashbuckle}} [SwaggerOperation("{{operationId}}")]{{#responses}}{{#dataType}} - [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}} + [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{/responses}}{{/useSwashbuckle}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/enumClass.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/enumClass.mustache index a8a68b998449..ba23434982af 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/enumClass.mustache @@ -1,12 +1,12 @@ /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} /// {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}} - public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} /// diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/formParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/formParam.mustache index 7c9085c62dfe..e2c1c23a4078 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/formParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/formParam.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isBinary}}[FromForm (Name = "{{baseName}}")]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isBinary}}[FromForm (Name = "{{baseName}}")]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/headerParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/headerParam.mustache index 45a5be9d7b5b..674e03952fdd 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/headerParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/headerParam.mustache @@ -1 +1 @@ -{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/listReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/listReturn.mustache index d609e67148c2..9f18d71d04c1 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/listReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/listReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject<{{returnContainer}}<{{#returnType}}{{{returnType}}}{{/returnType}}>>(exampleJson) - : Enumerable.Empty<{{#returnType}}{{{returnType}}}{{/returnType}}>(); \ No newline at end of file + ? JsonConvert.DeserializeObject<{{returnContainer}}<{{{returnType}}}>>(exampleJson) + : Enumerable.Empty<{{{returnType}}}>(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/mapReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/mapReturn.mustache index 856fb1b3507c..94f16e11fdc5 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/mapReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/mapReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject>(exampleJson) - : new Dictionary<{{#returnType}}{{{returnType}}}{{/returnType}}>(); \ No newline at end of file + ? JsonConvert.DeserializeObject>(exampleJson) + : new Dictionary<{{{returnType}}}>(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache index bf30b9f5795d..d28375e4b9b4 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache @@ -15,7 +15,7 @@ namespace {{packageName}}.Models /// {{description}} /// [DataContract] - public partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}> + public partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}> { {{#vars}} {{#items.isEnum}} @@ -31,20 +31,20 @@ namespace {{packageName}}.Models {{/complexType}} {{/isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} {{#required}} [Required] {{/required}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}})] {{#isEnum}} - public {{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}?{{/isContainer}}{{/isEnum}} {{name}} { get; set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}?{{/isContainer}}{{/isEnum}} {{name}} { get; set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^isEnum}} - public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^-last}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/objectReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/objectReturn.mustache index 4059a61ac0b8..b037a14ceba6 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/objectReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/objectReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject<{{#returnType}}{{{returnType}}}{{/returnType}}>(exampleJson) - : default({{#returnType}}{{{returnType}}}{{/returnType}}); \ No newline at end of file + ? JsonConvert.DeserializeObject<{{{returnType}}}>(exampleJson) + : default({{{returnType}}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/partial_header.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/partial_header.mustache index 9eb233d1197c..408d841df26d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/partial_header.mustache @@ -1,13 +1,13 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * Generated by: https://openapi-generator.tech */ diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/pathParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/pathParam.mustache index e2a30150536f..240144e0a806 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/pathParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/pathParam.mustache @@ -1 +1 @@ -{{#isPathParam}}[FromRoute (Name = "{{baseName}}")]{{#required}}[Required]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}[FromRoute (Name = "{{baseName}}")]{{#required}}[Required]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/queryParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/queryParam.mustache index cafc0ccf8680..b1d9a57e09d1 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/queryParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/queryParam.mustache @@ -1 +1 @@ -{{#isQueryParam}}[FromQuery (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}[FromQuery (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/validateModel.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/validateModel.mustache index e11aaa5d2708..0b2d5fdb70f0 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/validateModel.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/validateModel.mustache @@ -26,7 +26,7 @@ namespace {{packageName}}.Attributes { object args = null; if (context.ActionArguments.ContainsKey(parameter.Name)) - { + { args = context.ActionArguments[parameter.Name]; } diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Authentication/ApiAuthentication.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Authentication/ApiAuthentication.mustache index 755fefbd5064..10ca7809ab8c 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Authentication/ApiAuthentication.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Authentication/ApiAuthentication.mustache @@ -69,4 +69,3 @@ namespace {{packageName}}.Authentication } } } - diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Filters/GeneratePathParamsValidationFilter.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Filters/GeneratePathParamsValidationFilter.mustache index d857a4a0f960..e990e87db3b4 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Filters/GeneratePathParamsValidationFilter.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Filters/GeneratePathParamsValidationFilter.mustache @@ -94,4 +94,3 @@ namespace {{packageName}}.Filters } } } - diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Formatters/InputFormatterStream.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Formatters/InputFormatterStream.mustache index f1a002ded67c..e24d0a237a11 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Formatters/InputFormatterStream.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Formatters/InputFormatterStream.mustache @@ -13,7 +13,7 @@ namespace {{packageName}}.Formatters SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } - + protected override bool CanReadType(Type type) { if (type == typeof(Stream)) diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Program.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Program.mustache index 73cb81a3e411..ebe8176de556 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Program.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Program.mustache @@ -25,6 +25,6 @@ namespace {{packageName}} public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup() - .UseUrls("http://0.0.0.0:{{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}}/"); + .UseUrls("http://0.0.0.0:{{serverPort}}{{^serverPort}}8080{{/serverPort}}/"); } } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.csproj.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.csproj.mustache index 88a0fd7e44ef..f257cb18acaf 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.csproj.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.csproj.mustache @@ -1,6 +1,6 @@ - {{^packageDescription}}{{packageName}}{{/packageDescription}}{{packageDescription}} + {{packageDescription}}{{^packageDescription}}{{packageName}}{{/packageDescription}} {{packageCopyright}} {{packageAuthors}} netcoreapp{{aspnetCoreVersion}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.nuspec.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.nuspec.mustache index d6a52c2c20a9..0849b54d06db 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.nuspec.mustache @@ -12,7 +12,7 @@ http://ICON_URL_HERE_OR_DELETE_THIS_LINE --> false - {{^packageDescription}}{{packageName}}{{/packageDescription}}{{packageDescription}} + {{packageDescription}}{{^packageDescription}}{{packageName}}{{/packageDescription}} Summary of changes made in this release of the package. {{packageCopyright}} {{packageName}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/README.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/README.mustache index c5673ac9d1db..3602e5d507da 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/README.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/README.mustache @@ -1,7 +1,7 @@ # {{packageName}} - ASP.NET Core {{aspnetCoreVersion}} Server {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Run diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Startup.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Startup.mustache index 50ad25a5e419..7c25355f3914 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Startup.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Startup.mustache @@ -62,7 +62,7 @@ namespace {{packageName}} opts.InputFormatters.Insert(0, new InputFormatterStream()); }) {{#compatibilityVersion}} - .SetCompatibilityVersion(CompatibilityVersion.{{compatibilityVersion}}) + .SetCompatibilityVersion(CompatibilityVersion.{{.}}) {{/compatibilityVersion}} .{{#useNewtonsoft}}AddNewtonsoftJson{{/useNewtonsoft}}{{^useNewtonsoft}}AddJsonOptions{{/useNewtonsoft}}(opts => { @@ -77,25 +77,25 @@ namespace {{packageName}} services .AddSwaggerGen(c => { - c.SwaggerDoc("{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", new Info + c.SwaggerDoc("{{{version}}}{{^version}}v1{{/version}}", new Info { - Version = "{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", - Title = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}", - Description = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core {{aspnetCoreVersion}})", + Version = "{{{version}}}{{^version}}v1{{/version}}", + Title = "{{{appName}}}{{^appName}}{{packageName}}{{/appName}}", + Description = "{{{appName}}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core {{aspnetCoreVersion}})", Contact = new Contact() { - Name = "{{#infoName}}{{{infoName}}}{{/infoName}}{{^infoName}}OpenAPI-Generator Contributors{{/infoName}}", - Url = "{{#infoUrl}}{{{infoUrl}}}{{/infoUrl}}{{^infoUrl}}https://github.com/openapitools/openapi-generator{{/infoUrl}}", - Email = "{{#infoEmail}}{{{infoEmail}}}{{/infoEmail}}" + Name = "{{{infoName}}}{{^infoName}}OpenAPI-Generator Contributors{{/infoName}}", + Url = "{{{infoUrl}}}{{^infoUrl}}https://github.com/openapitools/openapi-generator{{/infoUrl}}", + Email = "{{{infoEmail}}}" }, - TermsOfService = "{{#termsOfService}}{{{termsOfService}}}{{/termsOfService}}" + TermsOfService = "{{{termsOfService}}}" }); c.CustomSchemaIds(type => type.FriendlyId(true)); c.DescribeAllEnumsAsStrings(); c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{Assembly.GetEntryAssembly().GetName().Name}.xml"); {{#basePathWithoutHost}} // Sets the basePath property in the Swagger document generated - c.DocumentFilter("{{{basePathWithoutHost}}}"); + c.DocumentFilter("{{{.}}}"); {{/basePathWithoutHost}} // Include DataAnnotation attributes on Controller Action parameters as Swagger validation rules (e.g required, pattern, ..) @@ -123,10 +123,10 @@ namespace {{packageName}} .UseSwaggerUI(c => { //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) - c.SwaggerEndpoint("/swagger/{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}/openapi.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}"); + c.SwaggerEndpoint("/swagger/{{{version}}}{{^version}}v1{{/version}}/openapi.json", "{{{appName}}}{{^appName}}{{packageName}}{{/appName}}"); //TODO: Or alternatively use the original Swagger contract that's included in the static files - // c.SwaggerEndpoint("/openapi-original.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} Original"); + // c.SwaggerEndpoint("/openapi-original.json", "{{{appName}}}{{^appName}}{{packageName}}{{/appName}} Original"); }){{/useSwashbuckle}}; {{^useDefaultRouting}} app.UseRouting(); diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache index c8203923b9de..52b6ec5c5ee7 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache @@ -23,14 +23,14 @@ namespace {{apiPackage}} /// /// {{description}} /// {{#description}} - [Description("{{description}}")]{{/description}} + [Description("{{.}}")]{{/description}} [ApiController] - public {{#classModifier}}{{classModifier}} {{/classModifier}}class {{classname}}Controller : ControllerBase + public {{#classModifier}}{{.}} {{/classModifier}}class {{classname}}Controller : ControllerBase { {{#operation}} /// - /// {{#summary}}{{summary}}{{/summary}} + /// {{summary}} /// {{#notes}} - /// {{notes}}{{/notes}}{{#allParams}} + /// {{.}}{{/notes}}{{#allParams}} /// {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}}{{/allParams}}{{#responses}} /// {{message}}{{/responses}} [{{httpMethod}}] @@ -48,14 +48,14 @@ namespace {{apiPackage}} {{/vendorExtensions.x-aspnetcore-consumes}} [ValidateModelState]{{#useSwashbuckle}} [SwaggerOperation("{{operationId}}")]{{#responses}}{{#dataType}} - [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}}{{^useSwashbuckle}}{{#responses}}{{#dataType}} - [ProducesResponseType(statusCode: {{code}}, type: typeof({{&dataType}}))]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}} + [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{/responses}}{{/useSwashbuckle}}{{^useSwashbuckle}}{{#responses}}{{#dataType}} + [ProducesResponseType(statusCode: {{code}}, type: typeof({{&dataType}}))]{{/dataType}}{{/responses}}{{/useSwashbuckle}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} public {{operationModifier}} {{#operationResultTask}}{{#operationIsAsync}}async {{/operationIsAsync}}Task<{{/operationResultTask}}IActionResult{{#operationResultTask}}>{{/operationResultTask}} {{operationId}}({{#allParams}}{{>pathParam}}{{>queryParam}}{{>bodyParam}}{{>formParam}}{{>headerParam}}{{^-last}}{{^isCookieParam}}, {{/isCookieParam}}{{/-last}}{{/allParams}}){{^generateBody}};{{/generateBody}} {{#generateBody}} - { + { {{#cookieParams}} var {{paramName}} = Request.Cookies["{{paramName}}"]; {{/cookieParams}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/enumClass.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/enumClass.mustache index 8a932b5ade61..cd6595452ae4 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/enumClass.mustache @@ -1,13 +1,13 @@ /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} /// {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} - {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}[TypeConverter(typeof(CustomEnumConverter<{{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}>))] + {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}[TypeConverter(typeof(CustomEnumConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}>))] [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}} - public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} /// diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/formParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/formParam.mustache index 7c9085c62dfe..e2c1c23a4078 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/formParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/formParam.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isBinary}}[FromForm (Name = "{{baseName}}")]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isBinary}}[FromForm (Name = "{{baseName}}")]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/headerParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/headerParam.mustache index a3a929904c62..a742a222236d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/headerParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/headerParam.mustache @@ -1 +1 @@ -{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/listReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/listReturn.mustache index d609e67148c2..9f18d71d04c1 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/listReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/listReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject<{{returnContainer}}<{{#returnType}}{{{returnType}}}{{/returnType}}>>(exampleJson) - : Enumerable.Empty<{{#returnType}}{{{returnType}}}{{/returnType}}>(); \ No newline at end of file + ? JsonConvert.DeserializeObject<{{returnContainer}}<{{{returnType}}}>>(exampleJson) + : Enumerable.Empty<{{{returnType}}}>(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/mapReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/mapReturn.mustache index 856fb1b3507c..94f16e11fdc5 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/mapReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/mapReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject>(exampleJson) - : new Dictionary<{{#returnType}}{{{returnType}}}{{/returnType}}>(); \ No newline at end of file + ? JsonConvert.DeserializeObject>(exampleJson) + : new Dictionary<{{{returnType}}}>(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache index 491b39e54a14..9b146b158715 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache @@ -17,7 +17,7 @@ namespace {{modelPackage}} /// {{description}} /// [DataContract] - public {{#modelClassModifier}}{{modelClassModifier}} {{/modelClassModifier}}class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}> + public {{#modelClassModifier}}{{.}} {{/modelClassModifier}}class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}> { {{#vars}} {{#items.isEnum}} @@ -33,21 +33,21 @@ namespace {{modelPackage}} {{/complexType}} {{/isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}}{{/description}}{{#required}} + /// {{.}}{{/description}}{{#required}} [Required]{{/required}}{{#pattern}} - [RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}} + [RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}} [StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} - [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}} + [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}} [Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}})] {{#isEnum}} - public {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{name}} { get; set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{name}} { get; set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^isEnum}} - public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^-last}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/objectReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/objectReturn.mustache index 4059a61ac0b8..b037a14ceba6 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/objectReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/objectReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject<{{#returnType}}{{{returnType}}}{{/returnType}}>(exampleJson) - : default({{#returnType}}{{{returnType}}}{{/returnType}}); \ No newline at end of file + ? JsonConvert.DeserializeObject<{{{returnType}}}>(exampleJson) + : default({{{returnType}}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/partial_header.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/partial_header.mustache index 9eb233d1197c..408d841df26d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/partial_header.mustache @@ -1,13 +1,13 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * Generated by: https://openapi-generator.tech */ diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/pathParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/pathParam.mustache index 3447b8005d13..83de202f6558 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/pathParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/pathParam.mustache @@ -1 +1 @@ -{{#isPathParam}}[FromRoute (Name = "{{baseName}}")]{{#required}}[Required]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}[FromRoute (Name = "{{baseName}}")]{{#required}}[Required]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/queryParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/queryParam.mustache index 3a052802fcd7..a0eedc432ff4 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/queryParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/queryParam.mustache @@ -1 +1 @@ -{{#isQueryParam}}[FromQuery (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}[FromQuery (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/validateModel.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/validateModel.mustache index e11aaa5d2708..0b2d5fdb70f0 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/validateModel.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/validateModel.mustache @@ -26,7 +26,7 @@ namespace {{packageName}}.Attributes { object args = null; if (context.ActionArguments.ContainsKey(parameter.Name)) - { + { args = context.ActionArguments[parameter.Name]; } diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Authentication/ApiAuthentication.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Authentication/ApiAuthentication.mustache index a9de368316d4..125b1e8ef2af 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Authentication/ApiAuthentication.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Authentication/ApiAuthentication.mustache @@ -68,4 +68,3 @@ namespace {{packageName}}.Authentication } } } - diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Filters/GeneratePathParamsValidationFilter.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Filters/GeneratePathParamsValidationFilter.mustache index f86af9fdd424..f62a1df49444 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Filters/GeneratePathParamsValidationFilter.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Filters/GeneratePathParamsValidationFilter.mustache @@ -95,4 +95,3 @@ namespace {{packageName}}.Filters } } } - diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Formatters/InputFormatterStream.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Formatters/InputFormatterStream.mustache index f1a002ded67c..e24d0a237a11 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Formatters/InputFormatterStream.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Formatters/InputFormatterStream.mustache @@ -13,7 +13,7 @@ namespace {{packageName}}.Formatters SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } - + protected override bool CanReadType(Type type) { if (type == typeof(Stream)) diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Program.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Program.mustache index 38cd18fc61f2..f575d1f5b63f 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Program.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Program.mustache @@ -27,7 +27,7 @@ namespace {{packageName}} .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup() - .UseUrls("http://0.0.0.0:{{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}}/"); + .UseUrls("http://0.0.0.0:{{serverPort}}{{^serverPort}}8080{{/serverPort}}/"); }); } } diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.csproj.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.csproj.mustache index ee3ced7ba192..889efc0161d2 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.csproj.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.csproj.mustache @@ -1,6 +1,6 @@ - {{^packageDescription}}{{packageName}}{{/packageDescription}}{{packageDescription}} + {{packageDescription}}{{^packageDescription}}{{packageName}}{{/packageDescription}} {{packageCopyright}} {{packageAuthors}} {{targetFramework}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.nuspec.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.nuspec.mustache index b97c14d13d35..1d24d3316421 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.nuspec.mustache @@ -12,7 +12,7 @@ http://ICON_URL_HERE_OR_DELETE_THIS_LINE --> false - {{^packageDescription}}{{packageName}}{{/packageDescription}}{{packageDescription}} + {{packageDescription}}{{^packageDescription}}{{packageName}}{{/packageDescription}} Summary of changes made in this release of the package. {{packageCopyright}} {{packageName}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/README.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/README.mustache index c5673ac9d1db..3602e5d507da 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/README.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/README.mustache @@ -1,7 +1,7 @@ # {{packageName}} - ASP.NET Core {{aspnetCoreVersion}} Server {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Run diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Startup.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Startup.mustache index 250dcf665848..d94e1e6bb193 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Startup.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Startup.mustache @@ -71,7 +71,7 @@ namespace {{packageName}} }) {{#compatibilityVersion}} // Don't need this for 3.x - see https://docs.microsoft.com/en-us/aspnet/core/mvc/compatibility-version?view=aspnetcore-3.1 - //.SetCompatibilityVersion(CompatibilityVersion.{{compatibilityVersion}}) + //.SetCompatibilityVersion(CompatibilityVersion.{{.}}) {{/compatibilityVersion}} .{{#useNewtonsoft}}AddNewtonsoftJson{{/useNewtonsoft}}{{^useNewtonsoft}}AddJsonOptions{{/useNewtonsoft}}(opts => { @@ -86,29 +86,29 @@ namespace {{packageName}} services .AddSwaggerGen(c => { - c.SwaggerDoc("{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", new OpenApiInfo + c.SwaggerDoc("{{{version}}}{{^version}}v1{{/version}}", new OpenApiInfo { - Title = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}", - Description = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core {{aspnetCoreVersion}})", - TermsOfService = new Uri("{{#termsOfService}}{{{termsOfService}}}{{/termsOfService}}{{^termsOfService}}https://github.com/openapitools/openapi-generator{{/termsOfService}}"), + Title = "{{{appName}}}{{^appName}}{{packageName}}{{/appName}}", + Description = "{{{appName}}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core {{aspnetCoreVersion}})", + TermsOfService = new Uri("{{{termsOfService}}}{{^termsOfService}}https://github.com/openapitools/openapi-generator{{/termsOfService}}"), Contact = new OpenApiContact { - Name = "{{#infoName}}{{{infoName}}}{{/infoName}}{{^infoName}}OpenAPI-Generator Contributors{{/infoName}}", - Url = new Uri("{{#infoUrl}}{{{infoUrl}}}{{/infoUrl}}{{^infoUrl}}https://github.com/openapitools/openapi-generator{{/infoUrl}}"), - Email = "{{#infoEmail}}{{{infoEmail}}}{{/infoEmail}}" + Name = "{{{infoName}}}{{^infoName}}OpenAPI-Generator Contributors{{/infoName}}", + Url = new Uri("{{{infoUrl}}}{{^infoUrl}}https://github.com/openapitools/openapi-generator{{/infoUrl}}"), + Email = "{{{infoEmail}}}" }, License = new OpenApiLicense { Name = "{{licenseName}}", Url = new Uri("{{licenseUrl}}") }, - Version = "{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", + Version = "{{{version}}}{{^version}}v1{{/version}}", }); c.CustomSchemaIds(type => type.FriendlyId(true)); c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{Assembly.GetEntryAssembly().GetName().Name}.xml"); {{#basePathWithoutHost}} // Sets the basePath property in the OpenAPI document generated - c.DocumentFilter("{{{basePathWithoutHost}}}"); + c.DocumentFilter("{{{.}}}"); {{/basePathWithoutHost}} // Include DataAnnotation attributes on Controller Action parameters as OpenAPI validation rules (e.g required, pattern, ..) @@ -151,10 +151,10 @@ namespace {{packageName}} // set route prefix to openapi, e.g. http://localhost:8080/openapi/index.html c.RoutePrefix = "openapi"; //TODO: Either use the SwaggerGen generated OpenAPI contract (generated from C# classes) - c.SwaggerEndpoint("/openapi/{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}/openapi.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}"); + c.SwaggerEndpoint("/openapi/{{{version}}}{{^version}}v1{{/version}}/openapi.json", "{{{appName}}}{{^appName}}{{packageName}}{{/appName}}"); //TODO: Or alternatively use the original OpenAPI contract that's included in the static files - // c.SwaggerEndpoint("/openapi-original.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} Original"); + // c.SwaggerEndpoint("/openapi-original.json", "{{{appName}}}{{^appName}}{{packageName}}{{/appName}} Original"); }){{/useSwashbuckle}}; app.UseRouting(); app.UseEndpoints(endpoints => diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/controller.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/controller.mustache index 9f6fcc803df6..ba1d43982a7d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/controller.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/controller.mustache @@ -23,14 +23,14 @@ namespace {{apiPackage}} /// /// {{description}} /// {{#description}} - [Description("{{description}}")]{{/description}} + [Description("{{.}}")]{{/description}} [ApiController] - public {{#classModifier}}{{classModifier}} {{/classModifier}}class {{classname}}Controller : ControllerBase + public {{#classModifier}}{{.}} {{/classModifier}}class {{classname}}Controller : ControllerBase { {{#operation}} /// - /// {{#summary}}{{summary}}{{/summary}} + /// {{summary}} /// {{#notes}} - /// {{notes}}{{/notes}}{{#allParams}} + /// {{.}}{{/notes}}{{#allParams}} /// {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}}{{/allParams}}{{#responses}} /// {{message}}{{/responses}} [{{httpMethod}}] @@ -48,14 +48,14 @@ namespace {{apiPackage}} {{/vendorExtensions.x-aspnetcore-consumes}} [ValidateModelState]{{#useSwashbuckle}} [SwaggerOperation("{{operationId}}")]{{#responses}}{{#dataType}} - [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}}{{^useSwashbuckle}}{{#responses}}{{#dataType}} - [ProducesResponseType(statusCode: {{code}}, type: typeof({{&dataType}}))]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}} + [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{/responses}}{{/useSwashbuckle}}{{^useSwashbuckle}}{{#responses}}{{#dataType}} + [ProducesResponseType(statusCode: {{code}}, type: typeof({{&dataType}}))]{{/dataType}}{{/responses}}{{/useSwashbuckle}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} public {{operationModifier}} {{#operationResultTask}}{{#operationIsAsync}}async {{/operationIsAsync}}Task<{{/operationResultTask}}IActionResult{{#operationResultTask}}>{{/operationResultTask}} {{operationId}}({{#allParams}}{{>pathParam}}{{>queryParam}}{{>bodyParam}}{{>formParam}}{{>headerParam}}{{^-last}}{{^isCookieParam}}, {{/isCookieParam}}{{/-last}}{{/allParams}}){{^generateBody}};{{/generateBody}} {{#generateBody}} - { + { {{#cookieParams}} var {{paramName}} = Request.Cookies["{{paramName}}"]; {{/cookieParams}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/enumClass.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/enumClass.mustache index 8a932b5ade61..cd6595452ae4 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/enumClass.mustache @@ -1,13 +1,13 @@ /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} /// {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} - {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}[TypeConverter(typeof(CustomEnumConverter<{{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}>))] + {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}[TypeConverter(typeof(CustomEnumConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}>))] [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}} - public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} /// diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/formParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/formParam.mustache index f0b9d704280e..d22f70b0e260 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/formParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/formParam.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isBinary}}[FromForm{{^isModel}} (Name = "{{baseName}}"){{/isModel}}]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isBinary}}[FromForm{{^isModel}} (Name = "{{baseName}}"){{/isModel}}]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/headerParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/headerParam.mustache index a3a929904c62..a742a222236d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/headerParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/headerParam.mustache @@ -1 +1 @@ -{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/listReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/listReturn.mustache index d609e67148c2..9f18d71d04c1 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/listReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/listReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject<{{returnContainer}}<{{#returnType}}{{{returnType}}}{{/returnType}}>>(exampleJson) - : Enumerable.Empty<{{#returnType}}{{{returnType}}}{{/returnType}}>(); \ No newline at end of file + ? JsonConvert.DeserializeObject<{{returnContainer}}<{{{returnType}}}>>(exampleJson) + : Enumerable.Empty<{{{returnType}}}>(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/mapReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/mapReturn.mustache index 856fb1b3507c..94f16e11fdc5 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/mapReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/mapReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject>(exampleJson) - : new Dictionary<{{#returnType}}{{{returnType}}}{{/returnType}}>(); \ No newline at end of file + ? JsonConvert.DeserializeObject>(exampleJson) + : new Dictionary<{{{returnType}}}>(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache index 5bd13ab9058a..917e36804923 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache @@ -30,7 +30,7 @@ namespace {{modelPackage}} [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] {{/mappedModels}} {{/discriminator}} - public {{#modelClassModifier}}{{modelClassModifier}} {{/modelClassModifier}}class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}> + public {{#modelClassModifier}}{{.}} {{/modelClassModifier}}class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}> { {{#vars}} {{#items.isEnum}} @@ -46,21 +46,21 @@ namespace {{modelPackage}} {{/complexType}} {{/isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}}{{/description}}{{#required}} + /// {{.}}{{/description}}{{#required}} [Required]{{/required}}{{#pattern}} - [RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}} + [RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}} [StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} - [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}} + [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}} [Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}})] {{#isEnum}} - public {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{name}} { get; set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{name}} { get; set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^isEnum}} - public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^-last}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/objectReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/objectReturn.mustache index 4059a61ac0b8..b037a14ceba6 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/objectReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/objectReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject<{{#returnType}}{{{returnType}}}{{/returnType}}>(exampleJson) - : default({{#returnType}}{{{returnType}}}{{/returnType}}); \ No newline at end of file + ? JsonConvert.DeserializeObject<{{{returnType}}}>(exampleJson) + : default({{{returnType}}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/partial_header.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/partial_header.mustache index 9eb233d1197c..408d841df26d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/partial_header.mustache @@ -1,13 +1,13 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * Generated by: https://openapi-generator.tech */ diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/pathParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/pathParam.mustache index 3447b8005d13..83de202f6558 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/pathParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/pathParam.mustache @@ -1 +1 @@ -{{#isPathParam}}[FromRoute (Name = "{{baseName}}")]{{#required}}[Required]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}[FromRoute (Name = "{{baseName}}")]{{#required}}[Required]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/queryParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/queryParam.mustache index 3a052802fcd7..a0eedc432ff4 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/queryParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/queryParam.mustache @@ -1 +1 @@ -{{#isQueryParam}}[FromQuery (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}[FromQuery (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/validateModel.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/validateModel.mustache index e11aaa5d2708..0b2d5fdb70f0 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/validateModel.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/validateModel.mustache @@ -26,7 +26,7 @@ namespace {{packageName}}.Attributes { object args = null; if (context.ActionArguments.ContainsKey(parameter.Name)) - { + { args = context.ActionArguments[parameter.Name]; } diff --git a/modules/openapi-generator/src/main/resources/bash/README.mustache b/modules/openapi-generator/src/main/resources/bash/README.mustache index 74f700ceb9e8..e320d2f99927 100644 --- a/modules/openapi-generator/src/main/resources/bash/README.mustache +++ b/modules/openapi-generator/src/main/resources/bash/README.mustache @@ -100,7 +100,7 @@ All URIs are relative to *{{basePathWithoutHost}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models @@ -126,8 +126,8 @@ Class | Method | HTTP request | Description - **Type**: OAuth - **Flow**: {{{flow}}}{{#authorizationUrl}} -- **Authorization URL**: {{{authorizationUrl}}}{{/authorizationUrl}}{{#tokenUrl}} -- **Token URL**: {{{tokenUrl}}}{{/tokenUrl}} +- **Authorization URL**: {{{.}}}{{/authorizationUrl}}{{#tokenUrl}} +- **Token URL**: {{{.}}}{{/tokenUrl}} - **Scopes**:{{^scopes}} N/A{{/scopes}} {{#scopes}} - **{{{scope}}}**: {{{description}}} {{/scopes}} diff --git a/modules/openapi-generator/src/main/resources/bash/api_doc.mustache b/modules/openapi-generator/src/main/resources/bash/api_doc.mustache index 0d7dbab61a7b..00bfe70e186d 100644 --- a/modules/openapi-generator/src/main/resources/bash/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/bash/api_doc.mustache @@ -1,12 +1,12 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePathWithoutHost}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -16,7 +16,7 @@ Method | HTTP request | Description {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Example @@ -29,7 +29,7 @@ Method | HTTP request | Description {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}} | {{{description}}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}} | {{{description}}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/bash/client.mustache b/modules/openapi-generator/src/main/resources/bash/client.mustache index 3f5dcc0e2918..634577842687 100644 --- a/modules/openapi-generator/src/main/resources/bash/client.mustache +++ b/modules/openapi-generator/src/main/resources/bash/client.mustache @@ -580,9 +580,9 @@ EOF {{#isOAuth}} echo -e " - ${MAGENTA}OAuth2 (flow: {{flow}})${OFF}"{{#authorizationUrl}} echo -e " Authorization URL: " - echo -e " * {{authorizationUrl}}"{{/authorizationUrl}}{{#tokenUrl}} + echo -e " * {{.}}"{{/authorizationUrl}}{{#tokenUrl}} echo -e " Token URL: " - echo -e " * {{tokenUrl}}"{{/tokenUrl}} + echo -e " * {{.}}"{{/tokenUrl}} echo -e " Scopes:" {{#scopes}} echo -e " * {{scope}} - {{description}}" @@ -613,7 +613,7 @@ echo " $ops" | column -t -s ';' echo -e " --about\\t\\t\\t\\tPrint the information about service" echo -e " --host ${CYAN}${OFF}\\t\\t\\t\\tSpecify the host URL " {{#openAPI}} -{{#host}}echo -e " \\t\\t\\t\\t(e.g. 'https://{{host}}')"{{/host}} +{{#host}}echo -e " \\t\\t\\t\\t(e.g. 'https://{{.}}')"{{/host}} {{^host}}echo -e " \\t\\t\\t\\t(e.g. 'https://127.0.0.1:8080')"{{/host}} {{/openAPI}} echo -e " --force\\t\\t\\t\\tForce command invocation in spite of missing" @@ -679,14 +679,14 @@ print_{{operationId}}_help() { {{/x-bash-codegen-description}} {{^x-bash-codegen-description}} {{#notes}} - echo -e "{{{notes}}}" | paste -sd' ' | fold -sw 80 + echo -e "{{{.}}}" | paste -sd' ' | fold -sw 80 echo -e "" {{/notes}} {{/x-bash-codegen-description}} {{/vendorExtensions}} {{^vendorExtensions}} {{#notes}} - echo -e "{{{notes}}}" | paste -sd' ' | fold -sw 80 + echo -e "{{{.}}}" | paste -sd' ' | fold -sw 80 echo -e "" {{/notes}} {{/vendorExtensions}} diff --git a/modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100755 --- a/modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/codegen/README.mustache b/modules/openapi-generator/src/main/resources/codegen/README.mustache index c55f0b6ce132..0ab1584ea15c 100644 --- a/modules/openapi-generator/src/main/resources/codegen/README.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/README.mustache @@ -10,7 +10,7 @@ The goal of OpenAPI is to define a standard, language-agnostic interface to REST When properly described with OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, OpenAPI removes the guesswork in calling the service. -Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project, including additional libraries with support for other languages and more. +Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project, including additional libraries with support for other languages and more. ## How do I use this? At this point, you've likely generated a client setup. It will include something along these lines: @@ -65,7 +65,7 @@ for reading the code more, though. See how the `{{generatorClass}}` implements That class has the signature of all values that can be overridden. You can also step through {{generatorClass}}.java in a debugger. Just debug the JUnit -test in DebugCodegenLauncher. That runs the command line tool and lets you inspect what the code is doing. +test in DebugCodegenLauncher. That runs the command line tool and lets you inspect what the code is doing. For the templates themselves, you have a number of values available to you for generation. You can execute the `java` command from above while passing different debug flags to show diff --git a/modules/openapi-generator/src/main/resources/codegen/generatorClass.mustache b/modules/openapi-generator/src/main/resources/codegen/generatorClass.mustache index d7b220b680f5..72755d960eb8 100644 --- a/modules/openapi-generator/src/main/resources/codegen/generatorClass.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/generatorClass.mustache @@ -14,7 +14,7 @@ public class {{generatorClass}} extends DefaultCodegen implements CodegenConfig /** * Configures the type of generator. - * + * * @return the CodegenType for this generator * @see org.openapitools.codegen.CodegenType */ @@ -25,7 +25,7 @@ public class {{generatorClass}} extends DefaultCodegen implements CodegenConfig /** * Configures a friendly name for the generator. This will be used by the generator * to select the library with the -g flag. - * + * * @return the friendly name for the generator */ public String getName() { @@ -60,7 +60,7 @@ public class {{generatorClass}} extends DefaultCodegen implements CodegenConfig /** * Returns human-friendly help for the generator. Provide the consumer with help * tips, parameters here - * + * * @return A string value for the help message */ public String getHelp() { @@ -147,7 +147,7 @@ public class {{generatorClass}} extends DefaultCodegen implements CodegenConfig /** * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping * those terms here. This logic is only called if a variable matches the reserved words - * + * * @return the escaped term */ @Override diff --git a/modules/openapi-generator/src/main/resources/codegen/generatorClassTest.mustache b/modules/openapi-generator/src/main/resources/codegen/generatorClassTest.mustache index 4267a928fcf4..d4773b14f813 100644 --- a/modules/openapi-generator/src/main/resources/codegen/generatorClassTest.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/generatorClassTest.mustache @@ -7,8 +7,8 @@ import org.openapitools.codegen.config.CodegenConfigurator; /*** * This test allows you to easily launch your code generation software under a debugger. - * Then run this test under debug mode. You will be able to step through your java code - * and then see the results in the out directory. + * Then run this test under debug mode. You will be able to step through your java code + * and then see the results in the out directory. * * To experiment with debugging your code generator: * 1) Set a break point in {{generatorClass}}.java in the postProcessOperationsWithModels() method. @@ -22,7 +22,7 @@ public class {{generatorClass}}Test { @Test public void launchCodeGenerator() { // to understand how the 'openapi-generator-cli' module is using 'CodegenConfigurator', have a look at the 'Generate' class: - // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java + // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("{{name}}") // use this codegen library .setInputSpec("../../../modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // sample OpenAPI file diff --git a/modules/openapi-generator/src/main/resources/codegen/kotlin/README.mustache b/modules/openapi-generator/src/main/resources/codegen/kotlin/README.mustache index 940ebbc0fa47..1c026bed904d 100644 --- a/modules/openapi-generator/src/main/resources/codegen/kotlin/README.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/kotlin/README.mustache @@ -17,7 +17,7 @@ ```bash java -jar build/libs/{{kebabName}}-openapi-generator-standalone.jar config-help -g {{name}} ``` - + ## Building ### Standalone diff --git a/modules/openapi-generator/src/main/resources/codegen/pom.mustache b/modules/openapi-generator/src/main/resources/codegen/pom.mustache index 628dd6552f75..a4f01d1cbbd8 100644 --- a/modules/openapi-generator/src/main/resources/codegen/pom.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/pom.mustache @@ -117,7 +117,7 @@ junit junit ${junit-version} - + UTF-8 diff --git a/modules/openapi-generator/src/main/resources/confluenceWikiDocs/index.mustache b/modules/openapi-generator/src/main/resources/confluenceWikiDocs/index.mustache index 9ddece9da196..86c92f99dfb3 100644 --- a/modules/openapi-generator/src/main/resources/confluenceWikiDocs/index.mustache +++ b/modules/openapi-generator/src/main/resources/confluenceWikiDocs/index.mustache @@ -2,7 +2,7 @@ h1. {{{appName}}} {{{appDescription}}} -{{#version}}*Version:* {{{version}}}{{/version}} +{{#version}}*Version:* {{{.}}}{{/version}} ---- @@ -15,7 +15,7 @@ h2. Endpoints h3. {{nickname}} {panel:title={{nickname}}|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} - {{#summary}}*Summary:* {{summary}}{{/summary}} + {{#summary}}*Summary:* {{.}}{{/summary}} *Description:* {{notes}}{{^notes}}*No Description*{{/notes}} || HttpMethod | {status:colour=Yellow|title={{httpMethod}}|subtle=false} | @@ -76,10 +76,10 @@ h2. Models h3. {{classname}} {{{description}}} - + {{#isEnum}} ||Name||Value||Description|| {{#allowableValues}} {{#enumVars}} |{{{name}}} |{{{value}}} |{{{enumDescription}}} | - {{/enumVars}} + {{/enumVars}} {{/allowableValues}} {{/isEnum}} {{^isEnum}}||Field Name||Required||Type||Description||Enum|| {{#vars}} |{{baseName}} |{{#required}}(/){{/required}}{{^required}}(x){{/required}} |{noformat:nopanel=true}{{{dataType}}}{noformat} |{{description}} | {{#isEnum}} {{_enum}} {{/isEnum}} | diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache index dad2eb75c6ce..7418caa9cddc 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache @@ -42,7 +42,7 @@ std::pair {{classname}}::handleParsingExcepti } catch ({{helpersNamespace}}::ValidationException &e) { return std::make_pair(Pistache::Http::Code::Bad_Request, e.what()); } catch (std::exception &e) { - return std::make_pair(Pistache::Http::Code::Internal_Server_Error, e.what()) + return std::make_pair(Pistache::Http::Code::Internal_Server_Error, e.what()); } } diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/helpers-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/helpers-source.mustache index 214086354d51..575dcf7b59c5 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/helpers-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/helpers-source.mustache @@ -11,7 +11,7 @@ const std::regex regexRfc3339_date_time( ); -namespace +namespace { // Determine if given year is a leap year // See RFC 3339, Appendix C https://tools.ietf.org/html/rfc3339#appendix-C diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/licenseInfo.mustache index 3a547de74bb7..8d5259173a1b 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * -* {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} -* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +* {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} +* {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache index 01d7882fa984..118db3cd98b6 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache @@ -54,7 +54,7 @@ int main() { std::vector sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP}; setUpUnixSignals(sigs); #endif - Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port({{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}})); + Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port({{serverPort}}{{^serverPort}}8080{{/serverPort}})); httpEndpoint = new Pistache::Http::Endpoint((addr)); auto router = std::make_shared(); @@ -76,4 +76,3 @@ int main() { httpEndpoint->shutdown(); } - diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache index bf88363b51cf..0da1decf03a4 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache @@ -328,7 +328,7 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { if ({{prefix}}HttpRequestWorker::sslDefaultConfiguration != nullptr) { request.setSslConfiguration(*{{prefix}}HttpRequestWorker::sslDefaultConfiguration); } - request.setRawHeader("User-Agent", "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{apiVersion}}/cpp-qt{{/httpUserAgent}}"); + request.setRawHeader("User-Agent", "{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{apiVersion}}/cpp-qt{{/httpUserAgent}}"); foreach (QString key, input->headers.keys()) { request.setRawHeader(key.toStdString().c_str(), input->headers.value(key).toStdString().c_str()); } if (request_content.size() > 0 && !isFormData && (input->var_layout != MULTIPART)) { diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/Project.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/Project.mustache index a815942bc7d0..c48c32708b9c 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/Project.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/Project.mustache @@ -43,4 +43,3 @@ SOURCES += \ $${PWD}/{{prefix}}Helpers.cpp \ $${PWD}/{{prefix}}HttpRequest.cpp \ $${PWD}/{{prefix}}HttpFileElement.cpp - diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/README.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/README.mustache index 9692bf79152c..0460040d2193 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/README.mustache @@ -8,7 +8,7 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) @@ -89,7 +89,7 @@ example.cpp: #include "../client/{{{classname}}}.h" #include "example.h" #include -#include +#include {{#allParams}} {{dataType}} Example::create(){ @@ -113,7 +113,7 @@ void Example::exampleFunction1(){ {{/authMethods}} {{/hasAuthMethods}} {{#allParams}} - + QEventLoop loop; connect(&apiInstance, &{{{classname}}}::{{nickname}}Signal, [&]() { loop.quit(); @@ -138,7 +138,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models @@ -148,7 +148,7 @@ Class | Method | HTTP request | Description ## Documentation for Servers -Parameterized Servers are supported. Define a server in the API for each endpoint with arbitrary numbers of variables: +Parameterized Servers are supported. Define a server in the API for each endpoint with arbitrary numbers of variables: ``` servers: @@ -173,7 +173,7 @@ To change the default variable, use this function in each Api: ``` int setDefaultServerValue(int serverIndex,const QString &operation, const QString &variable,const QString &val); ``` -The parameter "serverIndex" will choose a server from the server list for each endpoint. There is always at least one server with index 0. The Paramter "operation" should be the desired endpoint operationid. +The parameter "serverIndex" will choose a server from the server list for each endpoint. There is always at least one server with index 0. The Paramter "operation" should be the desired endpoint operationid. Variable is the name of the variable you wish to change and the value is the new default Value. The function will return -1 when the variable does not exists, -2 if value is not defined in the variable enum and -3 if the operation is not found. diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/ServerVariable.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/ServerVariable.mustache index 04abcf783ffc..6f5b287416ba 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/ServerVariable.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/ServerVariable.mustache @@ -19,11 +19,11 @@ public: * @param defaultValue The default value to use for substitution. * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. */ - {{prefix}}ServerVariable(const QString &description, const QString &defaultValue, const QSet &enumValues) + {{prefix}}ServerVariable(const QString &description, const QString &defaultValue, const QSet &enumValues) : _defaultValue(defaultValue), _description(description), _enumValues(enumValues){} - + {{prefix}}ServerVariable(){} ~{{prefix}}ServerVariable(){} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache index 639f2f766eaa..09449281ecd0 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache @@ -78,11 +78,11 @@ private: signals: {{#operations}}{{#operation}} - void {{nickname}}Signal({{#returnType}}{{{returnType}}} summary{{/returnType}});{{/operation}}{{/operations}} + void {{nickname}}Signal({{#returnType}}{{{.}}} summary{{/returnType}});{{/operation}}{{/operations}} {{#operations}}{{#operation}} - void {{nickname}}SignalFull({{prefix}}HttpRequestWorker *worker{{#returnType}}, {{{returnType}}} summary{{/returnType}});{{/operation}}{{/operations}} + void {{nickname}}SignalFull({{prefix}}HttpRequestWorker *worker{{#returnType}}, {{{.}}} summary{{/returnType}});{{/operation}}{{/operations}} {{#operations}}{{#operation}} - void {{nickname}}SignalE({{#returnType}}{{{returnType}}} summary, {{/returnType}}QNetworkReply::NetworkError error_type, QString error_str);{{/operation}}{{/operations}} + void {{nickname}}SignalE({{#returnType}}{{{.}}} summary, {{/returnType}}QNetworkReply::NetworkError error_type, QString error_str);{{/operation}}{{/operations}} {{#operations}}{{#operation}} void {{nickname}}SignalEFull({{prefix}}HttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);{{/operation}}{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/licenseInfo.mustache index 360883d9f9db..166d1da53c57 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - *{{#infoEmail}} Contact: {{{infoEmail}}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + *{{#infoEmail}} Contact: {{{.}}} *{{/infoEmail}} * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/model-header.mustache index 143f1424bfab..9179d3c7f7de 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/model-header.mustache @@ -46,7 +46,7 @@ public: {{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} {{{name}}}{{^-last}}, {{/-last}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.cpp.mustache index 90af1b39df39..27f5a4a97c10 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.cpp.mustache @@ -20,16 +20,16 @@ namespace {{this}} { } -{{#operations}}{{#operation}}void {{classname}}Handler::{{nickname}}({{#allParams}}{{{dataType}}}{{#isBodyParam}}{{/isBodyParam}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { +{{#operations}}{{#operation}}void {{classname}}Handler::{{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#allParams}} Q_UNUSED({{paramName}}); {{/allParams}} auto reqObj = qobject_cast<{{classname}}Request*>(sender()); - if( reqObj != nullptr ) - { - {{#returnType}}{{{returnType}}} res;{{/returnType}} + if( reqObj != nullptr ) + { + {{#returnType}}{{{.}}} res;{{/returnType}} reqObj->{{nickname}}Response({{#returnType}}res{{/returnType}}); - } + } } {{/operation}}{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.h.mustache index ab3fdb3d6a42..55a3e3db47fb 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.h.mustache @@ -14,14 +14,14 @@ namespace {{this}} { class {{classname}}Handler : public QObject { Q_OBJECT - + public: {{classname}}Handler(); virtual ~{{classname}}Handler(); public slots: - {{#operations}}{{#operation}}virtual void {{nickname}}({{#allParams}}{{{dataType}}}{{#isBodyParam}}{{/isBodyParam}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#operations}}{{#operation}}virtual void {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}}{{/operations}} }; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.cpp.mustache index ca8513d078dc..7799749ee8aa 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.cpp.mustache @@ -108,12 +108,12 @@ void {{classname}}Request::{{nickname}}Request({{#hasPathParams}}{{#pathParams}} {{/isArray}} {{/bodyParam}}{{/bodyParams}} - emit {{nickname}}({{#allParams}}{{#isBodyParam}}{{/isBodyParam}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + emit {{nickname}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); } {{/operation}}{{/operations}} -{{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Response({{#returnType}}const {{{returnType}}}& res{{/returnType}}){ +{{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Response({{#returnType}}const {{{.}}}& res{{/returnType}}){ setSocketResponseHeaders();{{#returnType}}{{#isMap}} QJsonDocument resDoc(::{{cppNamespace}}::toJsonValue(res).toObject()); socket->writeJson(resDoc);{{/isMap}}{{^isMap}}{{^returnTypeIsPrimitive}}{{^vendorExtensions.x-returns-enum}} @@ -129,7 +129,7 @@ void {{classname}}Request::{{nickname}}Request({{#hasPathParams}}{{#pathParams}} } {{/operation}}{{/operations}} -{{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Error({{#returnType}}const {{{returnType}}}& res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str){ +{{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Error({{#returnType}}const {{{.}}}& res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors setSocketResponseHeaders();{{#returnType}} Q_UNUSED(error_str); // response will be used instead of error string{{#isMap}} @@ -152,7 +152,7 @@ void {{classname}}Request::sendCustomResponse(QByteArray & res, QNetworkReply::N socket->write(res); if(socket->isOpen()){ socket->close(); - } + } } void {{classname}}Request::sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type){ diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.h.mustache index 7f78b9631737..b2fad55940be 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.h.mustache @@ -28,10 +28,10 @@ public: {{#operations}}{{#operation}}void {{nickname}}Request({{#hasPathParams}}{{#pathParams}}const QString& {{{paramName}}}{{^-last}}, {{/-last}}{{/pathParams}}{{/hasPathParams}}); {{/operation}}{{/operations}} - {{#operations}}{{#operation}}void {{nickname}}Response({{#returnType}}const {{{returnType}}}& res{{/returnType}}); + {{#operations}}{{#operation}}void {{nickname}}Response({{#returnType}}const {{{.}}}& res{{/returnType}}); {{/operation}}{{/operations}} - {{#operations}}{{#operation}}void {{nickname}}Error({{#returnType}}const {{{returnType}}}& res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str); + {{#operations}}{{#operation}}void {{nickname}}Error({{#returnType}}const {{{.}}}& res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str); {{/operation}}{{/operations}} void sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache index 2b1c0cf75da9..028a3097e256 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache @@ -89,7 +89,7 @@ private : } return QStringLiteral(""); } - + inline QRegularExpressionMatch getRequestMatch(QString serverTemplatePath, QString requestPath){ QRegularExpression parExpr( R"(\{([^\/\\s]+)\})" ); serverTemplatePath.replace( parExpr, R"((?<\1>[^\/\s]+))" ); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/licenseInfo.mustache index 360883d9f9db..166d1da53c57 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - *{{#infoEmail}} Contact: {{{infoEmail}}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + *{{#infoEmail}} Contact: {{{.}}} *{{/infoEmail}} * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/main.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/main.cpp.mustache index 5b4954ae4ff8..87b94f71ec6d 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/main.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/main.cpp.mustache @@ -58,7 +58,7 @@ int main(int argc, char * argv[]) QStringList() << "p" << "port", "port to listen on", "port", - "{{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}}" + "{{serverPort}}{{^serverPort}}8080{{/serverPort}}" ); parser.addOption(portOption); parser.addHelpOption(); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/model-header.mustache index 5bbe8c8c20e1..8a56eb6669e4 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/model-header.mustache @@ -44,7 +44,7 @@ public: {{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} {{{name}}}{{^-last}}, {{/-last}} diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/README.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/README.mustache index fa672709a8a9..62f5bac46d0b 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/README.mustache @@ -1,7 +1,7 @@ # C++ API client {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-gmock.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-gmock.mustache index 4eac5d61d497..d144bf6a064a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-gmock.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-gmock.mustache @@ -24,7 +24,7 @@ public: ~{{classname}}Mock() override = default; {{#operation}} - MOCK_METHOD{{allParams.size}}( {{operationId}}, pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> ( + MOCK_METHOD{{allParams.size}}( {{operationId}}, pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> ( {{#allParams}} {{^required}}boost::optional<{{/required}}{{#isFile}}std::shared_ptr<{{/isFile}}{{{dataType}}}{{#isFile}}>{{/isFile}}{{^required}}>{{/required}} {{paramName}}{{^-last}},{{/-last}} {{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-header.mustache index 4d2e796717a8..3b1c75e86d15 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-header.mustache @@ -31,7 +31,7 @@ public: virtual ~I{{classname}}() = default; {{#operation}} - virtual pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{operationId}}( + virtual pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{operationId}}( {{#allParams}} {{^required}}boost::optional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{^-last}},{{/-last}} {{/allParams}} @@ -65,7 +65,7 @@ public: {{#allParams}} /// {{#lambda.multiline_comment_4}}{{description}}{{/lambda.multiline_comment_4}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{operationId}}( + pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{operationId}}( {{#allParams}} {{^required}}boost::optional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{^-last}},{{/-last}} {{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache index 145f613b0b18..517af2c5d08a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache @@ -26,7 +26,7 @@ using namespace {{modelNamespace}}; } {{#operation}} -pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{classname}}::{{operationId}}({{#allParams}}{{^required}}boost::optional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) const +pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{classname}}::{{operationId}}({{#allParams}}{{^required}}boost::optional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) const { {{#allParams}}{{#required}}{{^isPrimitiveType}}{{^isContainer}} // verify the required parameter '{{paramName}}' is set diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/licenseInfo.mustache index 0342fdbca193..4b9c44b14bc0 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/licenseInfo.mustache @@ -3,10 +3,10 @@ * {{{appDescription}}} * {{#version}} - * The version of the OpenAPI document: {{{version}}} + * The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI-Generator {{{generatorVersion}}}. diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache index 109596f437e3..f8ba4b95e7fb 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache @@ -26,7 +26,7 @@ namespace {{this}} { {{/vendorExtensions.x-has-forward-declarations}} {{#isEnum}} class {{declspec}} {{classname}} - : public {{#parent}}{{{parent}}}{{/parent}}{{^parent}}ModelBase{{/parent}} + : public {{{parent}}}{{^parent}}ModelBase{{/parent}} { public: {{classname}}(); @@ -49,7 +49,7 @@ public: {{#enumVars}} {{#enumDescription}} /// - /// {{enumDescription}} + /// {{.}} /// {{/enumDescription}} {{classname}}_{{{name}}}{{^last}},{{/last}} @@ -70,7 +70,7 @@ public: /// {{description}} /// class {{declspec}} {{classname}} - : public {{#parent}}{{{parent}}}{{/parent}}{{^parent}}ModelBase{{/parent}} + : public {{{parent}}}{{^parent}}ModelBase{{/parent}} { public: {{classname}}(); diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache index 41eb29a56109..f9714b7b63fc 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache @@ -127,7 +127,7 @@ void {{classname}}::validate() web::json::value {{classname}}::toJson() const { {{#parent}} - web::json::value val = this->{{{parent}}}::toJson();{{/parent}} + web::json::value val = this->{{{.}}}::toJson();{{/parent}} {{^parent}} web::json::value val = web::json::value::object(); {{/parent}} @@ -144,7 +144,7 @@ bool {{classname}}::fromJson(const web::json::value& val) { bool ok = true; {{#parent}} - ok &= this->{{{parent}}}::fromJson(val); + ok &= this->{{{.}}}::fromJson(val); {{/parent}} {{#vars}}{{^isInherited}} if(val.has_field(utility::conversions::to_string_t("{{baseName}}"))) diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache index e9e60bd69838..b688c4fd1e57 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache @@ -201,7 +201,7 @@ bool ModelBase::fromString( const utility::string_t& val, std::shared_ptr& ou if(outVal == nullptr) { outVal = std::shared_ptr(new T()); - } + } if( outVal != nullptr ) { ok = outVal->fromJson(web::json::value::parse(val)); diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-header.mustache index c74cec16a4fe..30e1154cff5e 100644 --- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-header.mustache @@ -84,11 +84,11 @@ public: ~{{classname}}(); void startService(int const& port); void stopService(); - + protected: {{#operation}} std::shared_ptr<{{classname}}{{vendorExtensions.x-codegen-resource-name}}Resource> m_sp{{classname}}{{vendorExtensions.x-codegen-resource-name}}Resource; - {{/operation}} + {{/operation}} }; diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache index 4ded701c2ee1..e80c89321fcd 100644 --- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache @@ -33,7 +33,7 @@ void {{classname}}::startService(int const& port) { std::shared_ptr settings = std::make_shared(); settings->set_port(port); settings->set_root("{{contextPath}}"); - + this->start(settings); } @@ -217,7 +217,7 @@ void {{classname}}{{vendorExtensions.x-codegen-resource-name}}Resource::{{httpMe }); {{/hasBodyParam}} } -{{/vendorExtensions.x-codegen-other-methods}} +{{/vendorExtensions.x-codegen-other-methods}} {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100644 --- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/licenseInfo.mustache index e0d370894bbc..85213c8b15c7 100644 --- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI-Generator {{{generatorVersion}}}. * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-header.mustache index 090481e0a16c..805b0664ab2b 100644 --- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-header.mustache @@ -30,7 +30,7 @@ class {{declspec}} {{classname}} {{#interfaces}}{{#-first}}:{{/-first}}{{^-first public: {{classname}}(); virtual ~{{classname}}(); - + std::string toJsonString(bool prettyJson = false); void fromJsonString(std::string const& jsonString); boost::property_tree::ptree toPropertyTree(); diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/README.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/README.mustache index e749562a0aa3..2a47e520d3e9 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/README.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/README.mustache @@ -40,4 +40,3 @@ All URIs are relative to {{{scheme}}}://{{{host}}}{{{basePath}}} |------------- | -------------| {{#models}}{{#model}}|*{{classname}}* | {{{description}}}| {{/model}}{{/models}} - diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-body.mustache index c3935b37cde9..5fc0fc2f991a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-body.mustache @@ -23,39 +23,39 @@ jsonToValue(void* target, bourne::json value, std::string type) { if (target == NULL || value.is_null()) { return; - } - - else if (type.compare("bool") == 0) + } + + else if (type.compare("bool") == 0) { bool* val = static_cast (target); *val = value.to_bool(); - } - - else if (type.compare("int") == 0) + } + + else if (type.compare("int") == 0) { int* val = static_cast (target); *val = value.to_int(); - } - - else if (type.compare("float") == 0) + } + + else if (type.compare("float") == 0) { float* val = static_cast (target); *val = (float)(value.to_float()); - } + } else if (type.compare("long") == 0) { long* val = static_cast (target); *val = (long)(value.to_int()); - } - - else if (type.compare("double") == 0) + } + + else if (type.compare("double") == 0) { double* val = static_cast (target); *val = value.to_float(); - } - - else if (type.compare("std::string") == 0) + } + + else if (type.compare("std::string") == 0) { std::string* val = static_cast (target); *val = value.to_string(); diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-header.mustache index 5ef7d9afdf77..710a3333f587 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-header.mustache @@ -19,4 +19,3 @@ std::string stringify(float input); std::string stringify(std::string input); #endif /* TINY_CPP_CLIENT_HELPERS_H_ */ - diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/model-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/model-body.mustache index b2f2ee66fd9d..056ff957c200 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/model-body.mustache @@ -28,13 +28,13 @@ using namespace Tiny; void {{classname}}::fromJson(std::string jsonObj) -{ +{ bourne::json object = bourne::json::parse(jsonObj); {{#vars}} const char *{{name}}Key = "{{baseName}}"; - - if(object.has_key({{name}}Key)) + + if(object.has_key({{name}}Key)) { bourne::json value = object[{{name}}Key]; @@ -50,11 +50,11 @@ void {{#isPrimitiveType}} jsonToValue(&element, var, "{{dataType}}"); {{/isPrimitiveType}} - + {{^isPrimitiveType}} element.fromJson(var.dump()); {{/isPrimitiveType}} - + {{/items}} {{name}}_list.push_back(element); } @@ -64,7 +64,7 @@ void {{/isContainer}} {{^isContainer}} - + {{#isPrimitiveType}} jsonToValue(&{{name}}, value, "{{baseType}}"); {{/isPrimitiveType}} @@ -87,13 +87,13 @@ bourne::json bourne::json object = bourne::json::object(); {{#vars}} - + {{#isContainer}} {{#isArray}} - + {{#items}} {{#isPrimitiveType}} - + std::list<{{dataType}}> {{name}}_list = {{getter}}(); bourne::json {{name}}_arr = bourne::json::array(); @@ -103,7 +103,7 @@ bourne::json } object["{{name}}"] = {{name}}_arr; - + {{/isPrimitiveType}} {{^isPrimitiveType}} @@ -117,7 +117,7 @@ bourne::json } object["{{name}}"] = {{name}}_arr; - {{/isPrimitiveType}} + {{/isPrimitiveType}} {{/items}} {{/isArray}} {{/isContainer}} diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/root.cert.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/root.cert.mustache index bad9c08efad1..59d760f1e167 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/root.cert.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/root.cert.mustache @@ -50,4 +50,3 @@ "rqXRfboQnoZsG4q5WTP468SQvvG5\n" \ "-----END CERTIFICATE-----\n" \ */ - diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/run-tests.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/run-tests.mustache index 54bf326c43a3..dd22e7152582 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/run-tests.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/run-tests.mustache @@ -24,7 +24,7 @@ void runTests(){ {{/vars}} {{/model}}{{/models}} - + } int main(void) { @@ -40,5 +40,5 @@ void setup() { } void loop() { - + } diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/service/Response.h.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/service/Response.h.mustache index 9b7b616b8f1b..af7543e0c9b8 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/service/Response.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/service/Response.h.mustache @@ -21,5 +21,5 @@ template T obj; }; } // namespace Tinyclient - + #endif /* TINY_CPP_CLIENT_RESPONSE_H_ */ diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-body.mustache index dc1298688372..c151d92c4d87 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-body.mustache @@ -216,4 +216,3 @@ using namespace Tiny; {{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/unit-test-model.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/unit-test-model.mustache index 14894973b81f..c6b008606ed2 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/unit-test-model.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/unit-test-model.mustache @@ -14,7 +14,7 @@ using namespace Tiny; void test_{{classname}}_{{name}}_is_assigned_from_json() { {{#isInteger}} - bourne::json input = + bourne::json input = { "{{name}}", 1 }; @@ -26,7 +26,7 @@ void test_{{classname}}_{{name}}_is_assigned_from_json() {{#isString}} - bourne::json input = + bourne::json input = { "{{name}}", "hello" }; @@ -38,7 +38,7 @@ void test_{{classname}}_{{name}}_is_assigned_from_json() {{#isBoolean}} - bourne::json input = + bourne::json input = { "{{name}}", true }; @@ -50,7 +50,7 @@ void test_{{classname}}_{{name}}_is_assigned_from_json() {{#isLong}} - bourne::json input = + bourne::json input = { "{{name}}", 1 }; @@ -62,7 +62,7 @@ void test_{{classname}}_{{name}}_is_assigned_from_json() {{#isFloat}} - bourne::json input = + bourne::json input = { "{{name}}", 1.0 }; @@ -80,7 +80,7 @@ void test_{{classname}}_{{name}}_is_assigned_from_json() void test_{{classname}}_{{name}}_is_converted_to_json() { {{#isInteger}} - bourne::json input = + bourne::json input = { "{{name}}", 1 }; @@ -95,7 +95,7 @@ void test_{{classname}}_{{name}}_is_converted_to_json() {{/isInteger}} {{#isString}} - bourne::json input = + bourne::json input = { "{{name}}", "hello" }; @@ -110,7 +110,7 @@ void test_{{classname}}_{{name}}_is_converted_to_json() {{/isString}} {{#isBoolean}} - bourne::json input = + bourne::json input = { "{{name}}", true }; @@ -125,7 +125,7 @@ void test_{{classname}}_{{name}}_is_converted_to_json() {{/isBoolean}} {{#isLong}} - bourne::json input = + bourne::json input = { "{{name}}", 1 }; @@ -140,7 +140,7 @@ void test_{{classname}}_{{name}}_is_converted_to_json() {{/isLong}} {{#isFloat}} - bourne::json input = + bourne::json input = { "{{name}}", 1.0 }; diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/unittest.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/unittest.mustache index c6a1f23a6e39..6cb35dfc332c 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/unittest.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/unittest.mustache @@ -4,7 +4,7 @@ #include #include "bourne/json.hpp" -void setUp(){ +void setUp(){ } @@ -12,7 +12,7 @@ void tearDown(){ } void test_id_is_assigned(){ - bourne::json petJSON = + bourne::json petJSON = { "id", 1 }; @@ -24,19 +24,19 @@ void test_id_is_assigned(){ } void test_name_is_assigned(){ - bourne::json petJSON = + bourne::json petJSON = { "name", "Shiba" }; Tiny::Pet pet(petJSON.dump()); - + TEST_ASSERT_EQUAL_STRING("Shiba", pet.getName().c_str()); } void test_status_is_assigned(){ - bourne::json petJSON = + bourne::json petJSON = { "status", "Sold" }; @@ -48,13 +48,13 @@ void test_status_is_assigned(){ void test_category_object_is_assigned(){ - bourne::json catJSON = + bourne::json catJSON = { "id", 3, "name", "Small dog" }; - bourne::json petJSON = + bourne::json petJSON = { "category", catJSON, }; @@ -73,7 +73,7 @@ void test_photo_string_list_is_assigned(){ bourne::json photoARR = bourne::json::array("url1", "url2", "url3", "url4"); - bourne::json petJSON = + bourne::json petJSON = { "photoUrls", photoARR, }; @@ -84,14 +84,14 @@ void test_photo_string_list_is_assigned(){ } void test_tags_object_list_is_assigned(){ - bourne::json aTag = + bourne::json aTag = { "id", 2, "name", "Hello" }; bourne::json tagsARR = bourne::json::array(aTag); - bourne::json petJSON = + bourne::json petJSON = { "tags", tagsARR, }; @@ -126,7 +126,5 @@ void setup() { } void loop() { - -} - +} diff --git a/modules/openapi-generator/src/main/resources/cpp-tizen-client/Doxyfile.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/Doxyfile.mustache index a1bae5840c68..e4fc0125bf00 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tizen-client/Doxyfile.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tizen-client/Doxyfile.mustache @@ -154,7 +154,7 @@ FULL_PATH_NAMES = NO # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -163,7 +163,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -230,13 +230,13 @@ TAB_SIZE = 4 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = +ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -280,7 +280,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -616,7 +616,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -658,7 +658,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -671,7 +671,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -682,7 +682,7 @@ LAYOUT_FILE = # search path. Do not use file names with spaces, bibtex cannot handle them. See # also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -741,7 +741,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -788,7 +788,7 @@ RECURSIVE = NO # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -804,7 +804,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -815,13 +815,13 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = +EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -841,7 +841,7 @@ EXAMPLE_RECURSIVE = NO # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -858,7 +858,7 @@ IMAGE_PATH = # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -867,7 +867,7 @@ INPUT_FILTER = # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER ) will also be used to filter the input files that are used for @@ -882,14 +882,14 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1001,7 +1001,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1045,7 +1045,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1055,7 +1055,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1067,7 +1067,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- # defined cascading style sheet that is included after the standard style sheets @@ -1078,7 +1078,7 @@ HTML_STYLESHEET = # see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1088,7 +1088,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the stylesheet and background images according to @@ -1216,7 +1216,7 @@ GENERATE_HTMLHELP = NO # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler ( hhc.exe). If non-empty @@ -1224,7 +1224,7 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated ( # YES) or that it should be included in the master .chm file ( NO). @@ -1237,7 +1237,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated ( # YES) or a normal table of contents ( NO) in the .chm file. @@ -1267,7 +1267,7 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1292,7 +1292,7 @@ QHP_VIRTUAL_FOLDER = doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1300,21 +1300,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1447,7 +1447,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1455,7 +1455,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1515,7 +1515,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1531,7 +1531,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1541,7 +1541,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1602,7 +1602,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1618,7 +1618,7 @@ EXTRA_PACKAGES = # PROJECT_NAME), or the project number (see PROJECT_NUMBER). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1627,7 +1627,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1635,7 +1635,7 @@ LATEX_FOOTER = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1735,14 +1735,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # Configuration options related to the man page output @@ -1803,13 +1803,13 @@ XML_OUTPUT = xml # validating XML parser to check the syntax of the XML files. # This tag requires that the tag GENERATE_XML is set to YES. -XML_SCHEMA = +XML_SCHEMA = # The XML_DTD tag can be used to specify a XML DTD, which can be used by a # validating XML parser to check the syntax of the XML files. # This tag requires that the tag GENERATE_XML is set to YES. -XML_DTD = +XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to @@ -1886,7 +1886,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -1927,7 +1927,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -1935,7 +1935,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -1945,7 +1945,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -1954,7 +1954,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have an @@ -1983,13 +1983,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external class will be listed in the # class index. If set to NO only the inherited external classes will be listed. @@ -2037,14 +2037,14 @@ CLASS_DIAGRAMS = YES # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. -MSCGEN_PATH = +MSCGEN_PATH = # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES, the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2093,7 +2093,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2231,26 +2231,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-header.mustache index b6059901809d..4f2bec0027a1 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-header.mustache @@ -5,7 +5,7 @@ #include "{{modelNamePrefix}}BaseModel.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} @@ -15,16 +15,16 @@ public: {{classname}}(); ~{{classname}}(); - /* Sets the URL Endpoint. + /* Sets the URL Endpoint. * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ void SetURL(const FString& Url); /* Adds global header params to all requests */ void AddHeaderParam(const FString& Key, const FString& Value); void ClearHeaderParams(); - + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. - * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. * See also: Request::SetShouldRetry */ void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); FHttpRetrySystem::FManager& GetHttpRetryManager(); @@ -34,7 +34,7 @@ public: {{/operation}}{{/operations}} {{#operations}}{{#operation}}DECLARE_DELEGATE_OneParam(F{{operationIdCamelCase}}Delegate, const {{operationIdCamelCase}}Response&); {{/operation}}{{/operations}} - {{#operations}}{{#operation}}{{#description}}/* {{{description}}} */ + {{#operations}}{{#operation}}{{#description}}/* {{{.}}} */ {{/description}}FHttpRequestPtr {{operationIdCamelCase}}(const {{operationIdCamelCase}}Request& Request, const F{{operationIdCamelCase}}Delegate& Delegate = F{{operationIdCamelCase}}Delegate()) const; {{/operation}}{{/operations}} private: @@ -49,7 +49,7 @@ private: mutable FHttpRetrySystem::FManager* RetryManager = nullptr; mutable TUniquePtr DefaultRetryManager; }; - + {{#cppNamespaceDeclarations}} } {{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-header.mustache index f4810ba58888..99b57ea20ae6 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-header.mustache @@ -8,7 +8,7 @@ {{/imports}} {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} @@ -16,7 +16,7 @@ namespace {{this}} {{#operation}} /* {{summary}} {{#notes}} * - * {{notes}}{{/notes}} + * {{.}}{{/notes}} */ class {{dllapi}} {{classname}}::{{operationIdCamelCase}}Request : public Request { @@ -24,7 +24,7 @@ public: virtual ~{{operationIdCamelCase}}Request() {} void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; FString ComputePath() const final; - + {{#allParams}} {{#isEnum}} {{#allowableValues}} @@ -38,12 +38,12 @@ public: static FString EnumToString(const {{{enumName}}}& EnumValue); static bool EnumFromString(const FString& EnumAsString, {{{enumName}}}& EnumValue); - {{#description}}/* {{{description}}} */ - {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{#description}}/* {{{.}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}; {{/isEnum}} {{^isEnum}} - {{#description}}/* {{{description}}} */ - {{/description}}{{^required}}TOptional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{#description}}/* {{{.}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}; {{/isEnum}} {{/allParams}} }; @@ -56,8 +56,8 @@ public: void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; {{/responses.0}} bool FromJson(const TSharedPtr& JsonValue) final; - - {{#returnType}}{{{returnType}}} Content;{{/returnType}} + + {{#returnType}}{{{.}}} Content;{{/returnType}} }; {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache index 4d262483e1f3..30ed25d2658f 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache @@ -10,7 +10,7 @@ #include "PlatformHttp.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} {{#operations}}{{#operation}} @@ -28,7 +28,7 @@ inline FString ToString(const {{classname}}::{{operationIdCamelCase}}Request::{{ } {{/allowableValues}} - UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}} Value (%d)"), (int)Value); + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}} Value (%d)"), (int)Value); return TEXT(""); } @@ -46,7 +46,7 @@ inline bool FromString(const FString& EnumAsString, {{classname}}::{{operationId if(Found) Value = *Found; - return Found != nullptr; + return Found != nullptr; } bool {{classname}}::{{operationIdCamelCase}}Request::EnumFromString(const FString& EnumAsString, {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& EnumValue) @@ -89,9 +89,9 @@ FString {{classname}}::{{operationIdCamelCase}}Request::ComputePath() const { TEXT("{{baseName}}"), ToStringFormatArg({{paramName}}) }{{^-last}},{{/-last}}{{/pathParams}} }; FString Path = FString::Format(TEXT("{{{path}}}"), PathParams); - + {{/pathParams.0}} - {{#queryParams.0}} + {{#queryParams.0}} TArray QueryParams; {{#queryParams}} {{#required}} @@ -143,7 +143,7 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const FHtt HttpRequest->SetHeader(TEXT("{{baseName}}"), {{paramName}}.GetValue()); } {{/required}} - {{/headerParams}} + {{/headerParams}} {{/headerParams.0}} // Default to Json Body request @@ -178,7 +178,7 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const FHtt } else if (Consumes.Contains(TEXT("multipart/form-data"))) { - {{#formParams.0}} + {{#formParams.0}} HttpMultipartFormData FormData; {{#formParams}} {{#isContainer}} @@ -227,7 +227,7 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const FHtt } else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) { - {{#formParams.0}} + {{#formParams.0}} TArray FormParams; {{#formParams}} {{#isContainer}} @@ -250,7 +250,7 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const FHtt {{/isContainer}} {{/isFile}} {{/formParams}} - + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded; charset=utf-8")); HttpRequest->SetContentAsString(FString::Join(FormParams, TEXT("&"))); {{/formParams.0}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache index 2ab5b0db9cda..d2821b2daaa2 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache @@ -8,11 +8,11 @@ #include "Serialization/JsonSerializer.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} -{{classname}}::{{classname}}() +{{classname}}::{{classname}}() : Url(TEXT("{{basePath}}")) { } @@ -139,7 +139,7 @@ FHttpRequestPtr {{classname}}::{{operationIdCamelCase}}(const {{operationIdCamel } Request.SetupHttpRequest(HttpRequest); - + HttpRequest->OnProcessRequestComplete().BindRaw(this, &{{classname}}::On{{operationIdCamelCase}}Response, Delegate); HttpRequest->ProcessRequest(); return HttpRequest; diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache index cdbf87653d63..c584eadee581 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache @@ -11,7 +11,7 @@ class IHttpRequest; {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-source.mustache index b2dc14f3578e..6c7842d825a7 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-source.mustache @@ -9,7 +9,7 @@ #include "Misc/Paths.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/licenseInfo.mustache index 147bb985790b..b0182eea28a7 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}OpenAPI spec version: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator * https://github.com/OpenAPITools/openapi-generator diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-header.mustache index 2f5b6255f54a..7f083d7e26a8 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-header.mustache @@ -9,7 +9,7 @@ #include "Containers/Ticker.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} @@ -41,7 +41,7 @@ struct {{dllapi}} HttpRetryParams }; class {{dllapi}} Model -{ +{ public: virtual ~Model() {} virtual void WriteJson(JsonWriter& Writer) const = 0; diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-source.mustache index 57dc4fb4151c..1a551ca53152 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-source.mustache @@ -2,7 +2,7 @@ #include "{{modelNamePrefix}}BaseModel.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} @@ -12,10 +12,10 @@ bool HttpRetryManager::Tick(float DeltaTime) return true; } -HttpRetryParams::HttpRetryParams(const FRetryLimitCountSetting& InRetryLimitCountOverride /*= FRetryLimitCountSetting()*/, - const FRetryTimeoutRelativeSecondsSetting& InRetryTimeoutRelativeSecondsOverride /*= FRetryTimeoutRelativeSecondsSetting()*/, - const FRetryResponseCodes& InRetryResponseCodes /*= FRetryResponseCodes()*/, - const FRetryVerbs& InRetryVerbs /*= FRetryVerbs()*/, +HttpRetryParams::HttpRetryParams(const FRetryLimitCountSetting& InRetryLimitCountOverride /*= FRetryLimitCountSetting()*/, + const FRetryTimeoutRelativeSecondsSetting& InRetryTimeoutRelativeSecondsOverride /*= FRetryTimeoutRelativeSecondsSetting()*/, + const FRetryResponseCodes& InRetryResponseCodes /*= FRetryResponseCodes()*/, + const FRetryVerbs& InRetryVerbs /*= FRetryVerbs()*/, const FRetryDomainsPtr& InRetryDomains /*= FRetryDomainsPtr() */) : RetryLimitCountOverride(InRetryLimitCountOverride) , RetryTimeoutRelativeSecondsOverride(InRetryTimeoutRelativeSecondsOverride) diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-header.mustache index 8742ad7a85f5..ee709e587e3c 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-header.mustache @@ -6,7 +6,7 @@ {{/imports}} {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} {{#models}} @@ -34,14 +34,14 @@ public: {{/enumVars}} }; - Values Value{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}; + Values Value{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/allowableValues}} static FString EnumToString(const Values& EnumValue); static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); {{/isEnum}} {{^isEnum}} - FString Value{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}; + FString Value{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isEnum}} {{/isString}} {{#vars}} @@ -54,15 +54,15 @@ public: {{/enumVars}} }; {{/allowableValues}} - + static FString EnumToString(const {{{enumName}}}& EnumValue); static bool EnumFromString(const FString& EnumAsString, {{{enumName}}}& EnumValue); - {{#description}}/* {{{description}}} */ - {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{#description}}/* {{{.}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}; {{/isEnum}} {{^isEnum}} - {{#description}}/* {{{description}}} */ - {{/description}}{{^required}}TOptional<{{/required}}{{{datatype}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{#description}}/* {{{.}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatype}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}; {{/isEnum}} {{/vars}} }; diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache index 3022a7a935d7..d75b9dfa0d9c 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache @@ -7,7 +7,7 @@ #include "Templates/SharedPointer.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} {{#models}}{{#model}} @@ -24,7 +24,7 @@ inline FString ToString(const {{classname}}::Values& Value) } {{/allowableValues}} - UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::Values Value (%d)"), (int)Value); + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::Values Value (%d)"), (int)Value); return TEXT(""); } @@ -89,7 +89,7 @@ inline FString ToString(const {{classname}}::{{{enumName}}}& Value) } {{/allowableValues}} - UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{{enumName}}} Value (%d)"), (int)Value); + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{{enumName}}} Value (%d)"), (int)Value); return TEXT(""); } @@ -155,7 +155,7 @@ void {{classname}}::WriteJson(JsonWriter& Writer) const {{^required}} if ({{name}}.IsSet()) { - Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{name}}.GetValue()); + Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{name}}.GetValue()); } {{/required}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/module-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/module-source.mustache index 676633ea0d9f..e89bb28ed089 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/module-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/module-source.mustache @@ -11,4 +11,3 @@ void {{unrealModuleName}}Module::StartupModule() void {{unrealModuleName}}Module::ShutdownModule() { } - diff --git a/modules/openapi-generator/src/main/resources/crystal/README.mustache b/modules/openapi-generator/src/main/resources/crystal/README.mustache index 56a8bbf09d88..5a385b6bb456 100644 --- a/modules/openapi-generator/src/main/resources/crystal/README.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/README.mustache @@ -3,7 +3,7 @@ The Crystal module for the {{appName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -27,7 +27,7 @@ Add the following to shard.yaml ```yaml dependencies: {{{shardName}}}: - github: {{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}} + github: {{gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}} version: ~> {{shardVersion}} ``` diff --git a/modules/openapi-generator/src/main/resources/crystal/api.mustache b/modules/openapi-generator/src/main/resources/crystal/api.mustache index 787189be8544..81af036027ee 100644 --- a/modules/openapi-generator/src/main/resources/crystal/api.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/api.mustache @@ -12,34 +12,34 @@ module {{moduleName}} end {{#operation}} {{#summary}} - # {{{summary}}} + # {{{.}}} {{/summary}} {{#notes}} - # {{{notes}}} + # {{{.}}} {{/notes}} {{#allParams}} {{#required}} # @param {{paramName}} [{{{dataType}}}{{^required}}?{{/required}}] {{description}} {{/required}} {{/allParams}} - # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}] + # @return [{{{returnType}}}{{^returnType}}nil{{/returnType}}] def {{operationId}}({{#allParams}}{{paramName}} : {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) {{#returnType}}data, _status_code, _headers = {{/returnType}}{{operationId}}_with_http_info({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {{#returnType}}data{{/returnType}}{{^returnType}}nil{{/returnType}} end {{#summary}} - # {{summary}} + # {{.}} {{/summary}} {{#notes}} - # {{notes}} + # {{.}} {{/notes}} {{#allParams}} {{#required}} # @param {{paramName}} [{{{dataType}}}{{^required}}?{{/required}}] {{description}} {{/required}} {{/allParams}} - # @return [Array<({{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}, Integer, Hash)>] {{#returnType}}{{{returnType}}} data{{/returnType}}{{^returnType}}nil{{/returnType}}, response status code and response headers + # @return [Array<({{{returnType}}}{{^returnType}}nil{{/returnType}}, Integer, Hash)>] {{#returnType}}{{{.}}} data{{/returnType}}{{^returnType}}nil{{/returnType}}, response status code and response headers def {{operationId}}_with_http_info({{#allParams}}{{paramName}} : {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) if @api_client.config.debugging Log.debug {"Calling API: {{classname}}.{{operationId}} ..."} diff --git a/modules/openapi-generator/src/main/resources/crystal/api_client.mustache b/modules/openapi-generator/src/main/resources/crystal/api_client.mustache index 9852faa90f9c..a22a0b196d9d 100644 --- a/modules/openapi-generator/src/main/resources/crystal/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/api_client.mustache @@ -16,7 +16,7 @@ module {{moduleName}} # Initializes the ApiClient # @option config [Configuration] Configuration for initializing the object, default to Configuration.default def initialize(@config = Configuration.default) - @user_agent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/#{VERSION}/crystal{{/httpUserAgent}}" + @user_agent = "{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/#{VERSION}/crystal{{/httpUserAgent}}" @default_headers = { "User-Agent" => @user_agent } diff --git a/modules/openapi-generator/src/main/resources/crystal/api_doc.mustache b/modules/openapi-generator/src/main/resources/crystal/api_doc.mustache index bdeeb5689122..e02ac96a0bd7 100644 --- a/modules/openapi-generator/src/main/resources/crystal/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/api_doc.mustache @@ -1,6 +1,6 @@ # {{moduleName}}::{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* @@ -8,7 +8,7 @@ All URIs are relative to *{{basePath}}* | ------ | ------------ | ----------- | {{#operations}} {{#operation}} -| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} | +| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}} {{/operations}} @@ -21,7 +21,7 @@ All URIs are relative to *{{basePath}}* {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Examples @@ -98,7 +98,7 @@ This endpoint does not need any parameter. | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | {{/-first}} -| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} | +| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/crystal/api_info.mustache b/modules/openapi-generator/src/main/resources/crystal/api_info.mustache index 1b3f9cb5ac45..272f72624d58 100644 --- a/modules/openapi-generator/src/main/resources/crystal/api_info.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/api_info.mustache @@ -1,12 +1,12 @@ {{#appName}} -#{{{appName}}} +#{{{.}}} {{/appName}} {{#appDescription}} -#{{{appDescription}}} +#{{{.}}} {{/appDescription}} -{{#version}}The version of the OpenAPI document: {{version}}{{/version}} -{{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +{{#version}}The version of the OpenAPI document: {{.}}{{/version}} +{{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} Generated by: https://openapi-generator.tech OpenAPI Generator version: {{{generatorVersion}}} diff --git a/modules/openapi-generator/src/main/resources/crystal/api_test.mustache b/modules/openapi-generator/src/main/resources/crystal/api_test.mustache index f4e0eb49e648..71d88915868f 100644 --- a/modules/openapi-generator/src/main/resources/crystal/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/api_test.mustache @@ -18,15 +18,15 @@ require "time" {{#operation}} # unit tests for {{operationId}} {{#summary}} - # {{summary}} + # {{.}} {{/summary}} {{#notes}} - # {{notes}} + # {{.}} {{/notes}} {{#allParams}}{{#required}} # @param {{paramName}} {{description}} {{/required}}{{/allParams}} # @param [Hash] opts the optional parameters {{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}} -{{/required}}{{/allParams}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}] +{{/required}}{{/allParams}} # @return [{{{returnType}}}{{^returnType}}nil{{/returnType}}] describe "{{operationId}} test" do it "should work" do # assertion here. ref: https://crystal-lang.org/reference/guides/testing.html diff --git a/modules/openapi-generator/src/main/resources/crystal/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/crystal/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100755 --- a/modules/openapi-generator/src/main/resources/crystal/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/crystal/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/crystal/partial_model_generic.mustache index eaf47753fbad..3109cec79145 100644 --- a/modules/openapi-generator/src/main/resources/crystal/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/partial_model_generic.mustache @@ -1,12 +1,12 @@ {{#description}} - # {{{description}}} + # {{{.}}} {{/description}} class {{classname}}{{#parent}} < {{{.}}}{{/parent}} include JSON::Serializable {{#vars}} {{#description}} - # {{{description}}} + # {{{.}}} {{/description}} @[JSON::Field(key: {{{baseName}}}, type: {{{dataType}}}{{#default}}, default: {{{.}}}{{/default}}{{#isNullable}}, nilable: true, emit_null: true{{/isNullable}})] property {{{name}}} : {{{dataType}}} diff --git a/modules/openapi-generator/src/main/resources/crystal/partial_model_generic_doc.mustache b/modules/openapi-generator/src/main/resources/crystal/partial_model_generic_doc.mustache index f188dd23e6ec..95bdb7107c22 100644 --- a/modules/openapi-generator/src/main/resources/crystal/partial_model_generic_doc.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/partial_model_generic_doc.mustache @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | {{#vars}} -| **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#isReadOnly}}[readonly]{{/isReadOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} | +| **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#isReadOnly}}[readonly]{{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | {{/vars}} ## Example diff --git a/modules/openapi-generator/src/main/resources/crystal/partial_oneof_module.mustache b/modules/openapi-generator/src/main/resources/crystal/partial_oneof_module.mustache index 18c0a0cffdb2..024071e45a3e 100644 --- a/modules/openapi-generator/src/main/resources/crystal/partial_oneof_module.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/partial_oneof_module.mustache @@ -1,5 +1,5 @@ {{#description}} - # {{{description}}} + # {{{.}}} {{/description}} module {{classname}} class << self diff --git a/modules/openapi-generator/src/main/resources/csharp-dotnet2/README.mustache b/modules/openapi-generator/src/main/resources/csharp-dotnet2/README.mustache index 064df8eeafd0..16bd2ca86feb 100644 --- a/modules/openapi-generator/src/main/resources/csharp-dotnet2/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-dotnet2/README.mustache @@ -1,7 +1,7 @@ # {{packageName}} - the C# library for the {{appName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -117,7 +117,7 @@ All URIs are relative to *{{{basePath}}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/csharp-dotnet2/api.mustache b/modules/openapi-generator/src/main/resources/csharp-dotnet2/api.mustache index 5990a0fbbd8e..40e59a1ffb67 100644 --- a/modules/openapi-generator/src/main/resources/csharp-dotnet2/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-dotnet2/api.mustache @@ -18,11 +18,11 @@ namespace {{apiPackage}} /// {{summary}} {{notes}} /// {{#allParams}}/// {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{{returnType}}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} } @@ -84,11 +84,11 @@ namespace {{apiPackage}} /// {{summary}} {{notes}} /// {{#allParams}}/// {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set diff --git a/modules/openapi-generator/src/main/resources/csharp-dotnet2/api_doc.mustache b/modules/openapi-generator/src/main/resources/csharp-dotnet2/api_doc.mustache index 4b1e7d263b91..ea459620cdce 100644 --- a/modules/openapi-generator/src/main/resources/csharp-dotnet2/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-dotnet2/api_doc.mustache @@ -1,22 +1,22 @@ # {{apiPackage}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{{basePath}}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Example ```csharp @@ -78,7 +78,7 @@ namespace Example {{#summary}} // {{{.}}} {{/summary}} - {{#returnType}}{{returnType}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{.}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} Debug.WriteLine(result);{{/returnType}} } catch (Exception e) @@ -94,7 +94,7 @@ namespace Example {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{baseType}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{baseType}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/csharp-dotnet2/model.mustache b/modules/openapi-generator/src/main/resources/csharp-dotnet2/model.mustache index f9e13ed8f3cc..4a642e80e42a 100644 --- a/modules/openapi-generator/src/main/resources/csharp-dotnet2/model.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-dotnet2/model.mustache @@ -13,12 +13,12 @@ namespace {{modelPackage}} { /// {{description}} /// [DataContract] - public class {{classname}}{{#parent}} : {{{parent}}}{{/parent}} { + public class {{classname}}{{#parent}} : {{{.}}}{{/parent}} { {{#vars}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} /// {{#description}} - /// {{{description}}}{{/description}} + /// {{{.}}}{{/description}} [DataMember(Name="{{baseName}}", EmitDefaultValue=false)] [JsonProperty(PropertyName = "{{baseName}}")] {{#deprecated}} diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/Project.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/Project.mustache index 8ff5398633dd..0b24e4c020ac 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/Project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/Project.mustache @@ -59,7 +59,7 @@ ..\..\packages\{{dependency}}.{{dependencyVersion}}\lib\{{dependencyFramework}}\{{dependency}}.dll True - {{/dependencies}} + {{/dependencies}} @@ -77,4 +77,3 @@ - diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/api.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/api.mustache index eb34a7fd50e1..c680c47a114d 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/api.mustache @@ -46,11 +46,11 @@ namespace {{packageName}}.{{packageContext}}.Modules /// /// Context of request {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#asyncServer}}{{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}(NancyContext context{{#allParams.0}}, {{/allParams.0}}{{>paramsList}});{{^-last}} + {{#asyncServer}}{{#returnType}}Task<{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}(NancyContext context{{#allParams.0}}, {{/allParams.0}}{{>paramsList}});{{^-last}} {{/-last}}{{/operation}} } @@ -61,7 +61,7 @@ namespace {{packageName}}.{{packageContext}}.Modules public abstract class Abstract{{classname}}Service: {{interfacePrefix}}{{classname}}Service { {{#operation}}{{#isDeprecated}}[Obsolete] - {{/isDeprecated}}public virtual {{#asyncServer}}{{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}(NancyContext context{{#allParams.0}}, {{/allParams.0}}{{>paramsList}}) + {{/isDeprecated}}public virtual {{#asyncServer}}{{#returnType}}Task<{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}(NancyContext context{{#allParams.0}}, {{/allParams.0}}{{>paramsList}}) { {{^asyncServer}}{{#returnType}}return {{/returnType}}{{/asyncServer}}{{#asyncServer}}return {{/asyncServer}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); }{{^-last}} @@ -69,7 +69,7 @@ namespace {{packageName}}.{{packageContext}}.Modules {{/-last}}{{/operation}} {{#operation}}{{#isDeprecated}}[Obsolete] - {{/isDeprecated}}protected abstract {{#asyncServer}}{{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}({{>paramsList}});{{^-last}} + {{/isDeprecated}}protected abstract {{#asyncServer}}{{#returnType}}Task<{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}({{>paramsList}});{{^-last}} {{/-last}}{{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnum.mustache index 586b0e423c74..eb456ababf9e 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnum.mustache @@ -1,5 +1,5 @@ /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// public enum {{>innerApiEnumName}} { diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerModelEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerModelEnum.mustache index 19e4731f2cf4..3fd8e401dcf8 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerModelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerModelEnum.mustache @@ -1 +1 @@ -public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} }; \ No newline at end of file +public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} }; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/localDateConverter.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/localDateConverter.mustache index f8495d6fadd1..d709c22cc1b5 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/localDateConverter.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/localDateConverter.mustache @@ -8,8 +8,8 @@ using System.Collections.Generic; namespace {{packageName}}.{{packageContext}}.Utils { /// - /// (De)serializes a to a string using - /// the RFC3339 + /// (De)serializes a to a string using + /// the RFC3339 /// full-date format. /// public class LocalDateConverter : JavaScriptPrimitiveConverter, IApplicationStartup diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelEnum.mustache index 303e4c71c26f..01c5ec32aa1f 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelEnum.mustache @@ -1,10 +1,10 @@ /// - /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} - public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} /// diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelGeneric.mustache index cb217c51c55a..8bb564a79713 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelGeneric.mustache @@ -1,10 +1,10 @@ /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// - public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}> + public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{.}}}, {{/parent}} IEquatable<{{classname}}> { {{#vars}}{{^isInherited}} /// - /// {{^description}}{{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}{{{name}}}{{/description}} /// public {{>nullableDataType}} {{name}} { get; private set; } {{/isInherited}}{{/vars}} @@ -118,7 +118,7 @@ /// /// Sets value for {{classname}}.{{{name}}} property. /// - /// {{^description}}{{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}{{{name}}}{{/description}} public {{classname}}Builder {{name}}({{>nullableDataType}} value) { _{{name}} = value; diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelMutable.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelMutable.mustache index a9ef6c90bd33..3ab64e3b06e4 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelMutable.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelMutable.mustache @@ -15,12 +15,12 @@ namespace {{packageName}}.{{packageContext}}.Models {{#items}}{{>innerModelEnum}}{{/items}}{{/items.isEnum}}{{/vars}} /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// - public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}> + public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{.}}}, {{/parent}} IEquatable<{{classname}}> { {{#vars}}{{^isInherited}} /// - /// {{^description}}{{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}{{{name}}}{{/description}} /// public {{>nullableDataType}} {{name}} { get; set; } {{/isInherited}}{{/vars}} diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/nuspec.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/nuspec.mustache index 3ef4c7bbe261..65912590d191 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/nuspec.mustache @@ -8,7 +8,7 @@ openapi-generator false NancyFx {{packageName}} API{{#termsOfService}} - {{termsOfService}}{{/termsOfService}}{{#licenseUrl}} - {{licenseUrl}}{{/licenseUrl}} + {{.}}{{/termsOfService}}{{#licenseUrl}} + {{.}}{{/licenseUrl}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache index ead564144412..fe7eeb0b5804 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache @@ -111,7 +111,7 @@ namespace {{packageName}}.Client public Configuration() { Proxy = null; - UserAgent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"; + UserAgent = "{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"; BasePath = "{{{basePath}}}"; DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache index cc8c275e40bf..c762fda011f2 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache @@ -193,7 +193,7 @@ namespace {{packageName}}.Client } else if (header.Equals(HEADER_DATE)) { - var utcDateTime = dateTime.ToString("r").ToString(); + var utcDateTime = dateTime.ToUniversalTime().ToString("r"); HttpSignatureHeader.Add(header.ToLower(), utcDateTime); HttpSignedRequestHeader.Add(HEADER_DATE, utcDateTime); } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache index b15d2a25bf19..1d1a37e16ae4 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache @@ -1,7 +1,7 @@ # {{packageName}} - the C# library for the {{appName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -114,7 +114,7 @@ HttpClient yourHttpClient = new HttpClient(yourHandler); var api = new YourApiClass(yourHttpClient, yourHandler); ``` -If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory. +If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory. ```csharp HttpClient yourHttpClient = new HttpClient(); @@ -125,7 +125,7 @@ You'll loose some configuration settings, the features affected are: Setting and Here an example of DI setup in a sample web project: ```csharp -services.AddHttpClient(httpClient => +services.AddHttpClient(httpClient => new PetApi(httpClient)); ``` @@ -200,7 +200,7 @@ namespace Example {{#summary}} // {{{.}}} {{/summary}} - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} Debug.WriteLine(result);{{/returnType}} } catch (ApiException e) @@ -222,7 +222,7 @@ All URIs are relative to *{{{basePath}}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache index b1a50ae778e3..57e1455087f0 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache @@ -1,15 +1,15 @@ @@ -33,4 +33,3 @@ - diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache index bb4894411bc0..237a14f92b7f 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache @@ -26,16 +26,16 @@ namespace {{packageName}}.{{apiPackage}} /// {{#notes}} /// - /// {{notes}} + /// {{.}} /// {{/notes}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); /// /// {{summary}} @@ -45,11 +45,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} #endregion Synchronous Operations } @@ -73,11 +73,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// {{summary}} @@ -90,11 +90,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); {{/operation}} #endregion Asynchronous Operations } @@ -233,11 +233,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} @@ -248,11 +248,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#allParams}} {{#required}} @@ -300,14 +300,14 @@ namespace {{packageName}}.{{apiPackage}} {{#required}} {{#isDeepObject}} {{#items.vars}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); {{/items.vars}} {{^items}} localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); {{/items}} {{/isDeepObject}} {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); {{/isDeepObject}} {{/required}} {{^required}} @@ -317,7 +317,7 @@ namespace {{packageName}}.{{apiPackage}} {{#items.vars}} if ({{paramName}}.{{name}} != null) { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); } {{/items.vars}} {{^items}} @@ -325,7 +325,7 @@ namespace {{packageName}}.{{apiPackage}} {{/items}} {{/isDeepObject}} {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); {{/isDeepObject}} } {{/required}} @@ -430,7 +430,7 @@ namespace {{packageName}}.{{apiPackage}} {{/authMethods}} // make the HTTP request - var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { @@ -450,11 +450,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} @@ -468,11 +468,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { {{#allParams}} {{#required}} @@ -520,12 +520,12 @@ namespace {{packageName}}.{{apiPackage}} {{/pathParams}} {{#queryParams}} {{#required}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); {{/required}} {{^required}} if ({{paramName}} != null) { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); } {{/required}} {{/queryParams}} @@ -632,7 +632,7 @@ namespace {{packageName}}.{{apiPackage}} // make the HTTP request - var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache index d12ee22ea388..1286829ad402 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache @@ -1,22 +1,22 @@ # {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{{basePath}}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Example ```csharp @@ -84,7 +84,7 @@ namespace Example {{#summary}} // {{{.}}} {{/summary}} - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} Debug.WriteLine(result);{{/returnType}} } catch (ApiException e) @@ -102,7 +102,7 @@ namespace Example {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api_test.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api_test.mustache index 02ca26b5f169..3f2f1de5bb37 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api_test.mustache @@ -64,7 +64,7 @@ namespace {{packageName}}.Test.Api {{/allParams}} //{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#returnType}} - //Assert.IsType<{{{returnType}}}>(response); + //Assert.IsType<{{{.}}}>(response); {{/returnType}} } {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache index 027fc5377432..fcc73e2ff8e6 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache @@ -169,7 +169,7 @@ namespace {{packageName}}.Client private readonly string _baseUrl; private readonly HttpClientHandler _httpClientHandler; - private readonly HttpClient _httpClient; + private readonly HttpClient _httpClient; private readonly bool _disposeClient; /// @@ -196,9 +196,9 @@ namespace {{packageName}}.Client /// public ApiClient() : this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) - { + { } - + /// /// Initializes a new instance of the . /// **IMPORTANT** This will also create an istance of HttpClient, which is less than ideal. @@ -207,7 +207,7 @@ namespace {{packageName}}.Client /// The target service's base path in URL format. /// public ApiClient(string basePath) - { + { if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); _httpClientHandler = new HttpClientHandler(); @@ -215,7 +215,7 @@ namespace {{packageName}}.Client _disposeClient = true; _baseUrl = basePath; } - + /// /// Initializes a new instance of the , defaulting to the global configurations' base url. /// @@ -228,9 +228,9 @@ namespace {{packageName}}.Client /// public ApiClient(HttpClient client, HttpClientHandler handler = null) : this(client, {{packageName}}.Client.GlobalConfiguration.Instance.BasePath, handler) - { + { } - + /// /// Initializes a new instance of the . /// @@ -244,10 +244,10 @@ namespace {{packageName}}.Client /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. /// public ApiClient(HttpClient client, string basePath, HttpClientHandler handler = null) - { + { if (client == null) throw new ArgumentNullException("client cannot be null"); if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); - + _httpClientHandler = handler; _httpClient = client; _baseUrl = basePath; @@ -509,7 +509,7 @@ namespace {{packageName}}.Client { return await ToApiResponse(response, default(T), req.RequestUri); } - + object responseData = await deserializer.Deserialize(response); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/api.mustache index bf3e4377995e..7f85a719ddf9 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/api.mustache @@ -27,16 +27,16 @@ namespace {{packageName}}.{{apiPackage}} /// {{#notes}} /// - /// {{notes}} + /// {{.}} /// {{/notes}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); /// /// {{summary}} @@ -46,11 +46,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} #endregion Synchronous Operations } @@ -74,11 +74,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// {{summary}} @@ -91,11 +91,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); {{/operation}} #endregion Asynchronous Operations } @@ -331,11 +331,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} @@ -346,11 +346,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#allParams}} {{#required}} @@ -398,14 +398,14 @@ namespace {{packageName}}.{{apiPackage}} {{#required}} {{#isDeepObject}} {{#items.vars}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); {{/items.vars}} {{^items}} localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); {{/items}} {{/isDeepObject}} {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); {{/isDeepObject}} {{/required}} {{^required}} @@ -415,7 +415,7 @@ namespace {{packageName}}.{{apiPackage}} {{#items.vars}} if ({{paramName}}.{{name}} != null) { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); } {{/items.vars}} {{^items}} @@ -423,7 +423,7 @@ namespace {{packageName}}.{{apiPackage}} {{/items}} {{/isDeepObject}} {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); {{/isDeepObject}} } {{/required}} @@ -528,7 +528,7 @@ namespace {{packageName}}.{{apiPackage}} {{/authMethods}} // make the HTTP request - var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { @@ -548,11 +548,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} @@ -566,11 +566,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { {{#allParams}} {{#required}} @@ -618,12 +618,12 @@ namespace {{packageName}}.{{apiPackage}} {{/pathParams}} {{#queryParams}} {{#required}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); {{/required}} {{^required}} if ({{paramName}} != null) { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); } {{/required}} {{/queryParams}} @@ -730,7 +730,7 @@ namespace {{packageName}}.{{apiPackage}} // make the HTTP request - var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache index c1b96657ae08..807aa3b47ef7 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache @@ -1,9 +1,9 @@ /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// [JsonConverter(typeof({{classname}}JsonConverter))] [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} { {{#isNullable}} /// diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelEnum.mustache index c977374019f9..d781952b4e09 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelEnum.mustache @@ -1,8 +1,8 @@ /// - /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} {{#allowableValues}} {{#enumVars}} @@ -13,7 +13,7 @@ {{/-first}} {{/enumVars}} {{/allowableValues}} - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache index ad65a3b83613..aaff4be3e255 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache @@ -1,5 +1,5 @@ /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// [DataContract(Name = "{{{name}}}")] {{#discriminator}} @@ -8,7 +8,7 @@ [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] {{/mappedModels}} {{/discriminator}} - {{>visibility}} partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} { {{#vars}} {{#items.isEnum}} @@ -26,17 +26,17 @@ {{#isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} [Obsolete] {{/deprecated}} - public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } {{#isReadOnly}} /// @@ -55,8 +55,8 @@ {{#deprecated}} [Obsolete] {{/deprecated}} - public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } - + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + /// /// Returns false as {{name}} should not be serialized given that it's read-only. @@ -67,14 +67,14 @@ return false; } {{/isReadOnly}} - + {{^isReadOnly}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} [Obsolete] {{/deprecated}} - public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} - { + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} + { get{ return _{{name}};} set { @@ -82,7 +82,7 @@ _flag{{name}} = true; } } - private {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} _{{name}}; + private {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} _{{name}}; private bool _flag{{name}}; /// @@ -118,7 +118,7 @@ /// Initializes a new instance of the class. /// {{#readWriteVars}} - /// {{#description}}{{description}}{{/description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}. + /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. {{/readWriteVars}} {{#hasOnlyReadOnly}} [JsonConstructorAttribute] @@ -185,9 +185,9 @@ {{^isInherited}} {{^isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}}{{/description}} + /// {{.}}{{/description}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] {{#isDate}} @@ -219,7 +219,7 @@ [Obsolete] {{/deprecated}} public {{{dataType}}} {{name}} { get; private set; } - + /// /// Returns false as {{name}} should not be serialized given that it's read-only. /// @@ -238,13 +238,13 @@ [Obsolete] {{/deprecated}} public {{{dataType}}} {{name}} - { + { get{ return _{{name}};} set { _{{name}} = value; _flag{{name}} = true; - } + } } private {{{dataType}}} _{{name}}; private bool _flag{{name}}; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelInnerEnum.mustache index 90090fea8c93..6af921832af4 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelInnerEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelInnerEnum.mustache @@ -1,14 +1,14 @@ {{^isContainer}} /// - /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} {{#isString}} [JsonConverter(typeof(StringEnumConverter))] {{/isString}} - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache index 59e2dbf19eb4..9d8247195b60 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache @@ -1,9 +1,9 @@ /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// [JsonConverter(typeof({{classname}}JsonConverter))] [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} { {{#isNullable}} /// diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache index 4f29dcf3d34c..3be35749bea8 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache @@ -14,11 +14,11 @@ {{packageName}} {{packageVersion}} bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} - {{licenseId}}{{/licenseId}} + {{.}}{{/licenseId}} https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git git{{#releaseNote}} - {{releaseNote}}{{/releaseNote}}{{#packageTags}} - {{{packageTags}}}{{/packageTags}} + {{.}}{{/releaseNote}}{{#packageTags}} + {{{.}}}{{/packageTags}} {{#nullableReferenceTypes}} annotations {{/nullableReferenceTypes}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache index 66254acffd40..9370bb01d64b 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache @@ -21,10 +21,10 @@ nuget.org gallery uses information you add in the portal. --> {{packageDescription}} {{#termsOfService}} - {{termsOfService}} + {{.}} {{/termsOfService}} {{#licenseUrl}} - {{licenseUrl}} + {{.}} {{/licenseUrl}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/partial_header.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/partial_header.mustache index 755e937d23b5..1562058ad8a0 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/partial_header.mustache @@ -1,17 +1,17 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} {{#version}} - * The version of the OpenAPI document: {{{version}}} + * The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache b/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache index 65f1de6a8d89..b21c370a0434 100644 --- a/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache @@ -107,7 +107,7 @@ namespace {{packageName}}.Client /// public Configuration() { - UserAgent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"; + UserAgent = "{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"; BasePath = "{{{basePath}}}"; DefaultHeader = new {{^net35}}Concurrent{{/net35}}Dictionary(); ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); @@ -180,7 +180,7 @@ namespace {{packageName}}.Client string tempFolderPath = null, string dateTimeFormat = null, int timeout = 100000, - string userAgent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}" + string userAgent = "{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}" // ReSharper restore UnusedParameter.Local ) { diff --git a/modules/openapi-generator/src/main/resources/csharp/Project.mustache b/modules/openapi-generator/src/main/resources/csharp/Project.mustache index c1862f7cb8c2..04458a3d1684 100644 --- a/modules/openapi-generator/src/main/resources/csharp/Project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/Project.mustache @@ -1,15 +1,15 @@ @@ -118,4 +118,3 @@ {{/netStandard}} - diff --git a/modules/openapi-generator/src/main/resources/csharp/README.mustache b/modules/openapi-generator/src/main/resources/csharp/README.mustache index 4b0d636d62cc..19fdde43db57 100644 --- a/modules/openapi-generator/src/main/resources/csharp/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/README.mustache @@ -1,7 +1,7 @@ # {{packageName}} - the C# library for the {{appName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -178,7 +178,7 @@ All URIs are relative to *{{{basePath}}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/csharp/TestProject.mustache b/modules/openapi-generator/src/main/resources/csharp/TestProject.mustache index 3e850f2f3ac6..1068f8db2473 100644 --- a/modules/openapi-generator/src/main/resources/csharp/TestProject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/TestProject.mustache @@ -1,15 +1,15 @@ @@ -98,4 +98,3 @@ - diff --git a/modules/openapi-generator/src/main/resources/csharp/api.mustache b/modules/openapi-generator/src/main/resources/csharp/api.mustache index 8e80b857ad5e..d2dda8824f67 100644 --- a/modules/openapi-generator/src/main/resources/csharp/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/api.mustache @@ -32,11 +32,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); /// /// {{summary}} @@ -46,11 +46,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} #endregion Synchronous Operations {{#supportsAsync}} @@ -65,11 +65,11 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}}/// Cancellation Token to cancel request (optional) - /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)); /// /// {{summary}} @@ -80,11 +80,11 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}}/// Cancellation Token to cancel request (optional) - /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)); {{/operation}} #endregion Asynchronous Operations {{/supportsAsync}} @@ -204,11 +204,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} @@ -219,11 +219,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#allParams}} {{#required}} @@ -263,7 +263,7 @@ namespace {{packageName}}.{{apiPackage}} if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", this.Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter {{/pathParams}} {{#queryParams}} - if ({{paramName}} != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); // query parameter + if ({{paramName}} != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("{{collectionFormat}}", "{{baseName}}", {{paramName}})); // query parameter {{/queryParams}} {{#headerParams}} if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", this.Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter @@ -339,7 +339,7 @@ namespace {{packageName}}.{{apiPackage}} {{#returnType}} return new ApiResponse<{{{returnType}}}>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}, x => string.Join(",", x.Value){{#caseInsensitiveResponseHeaders}}, StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), - ({{{returnType}}}) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); + ({{{returnType}}}) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof({{{returnContainer}}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); {{/returnType}} {{^returnType}} return new ApiResponse(localVarStatusCode, @@ -355,11 +355,11 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}}/// Cancellation Token to cancel request (optional) - /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)) { {{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken);{{/returnType}} @@ -372,11 +372,11 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}}/// Cancellation Token to cancel request (optional) - /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)) { {{#allParams}} {{#required}} @@ -416,7 +416,7 @@ namespace {{packageName}}.{{apiPackage}} if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", this.Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter {{/pathParams}} {{#queryParams}} - if ({{paramName}} != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); // query parameter + if ({{paramName}} != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("{{collectionFormat}}", "{{baseName}}", {{paramName}})); // query parameter {{/queryParams}} {{#headerParams}} if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", this.Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter @@ -492,7 +492,7 @@ namespace {{packageName}}.{{apiPackage}} {{#returnType}} return new ApiResponse<{{{returnType}}}>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}, x => string.Join(",", x.Value){{#caseInsensitiveResponseHeaders}}, StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), - ({{{returnType}}}) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); + ({{{returnType}}}) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof({{{returnContainer}}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); {{/returnType}} {{^returnType}} return new ApiResponse(localVarStatusCode, diff --git a/modules/openapi-generator/src/main/resources/csharp/api_doc.mustache b/modules/openapi-generator/src/main/resources/csharp/api_doc.mustache index 5b1c686cd371..617e197006de 100644 --- a/modules/openapi-generator/src/main/resources/csharp/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/api_doc.mustache @@ -1,12 +1,12 @@ # {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{{basePath}}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{{operationId}}} -> {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Example @@ -77,7 +77,7 @@ namespace Example {{#summary}} // {{{.}}} {{/summary}} - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} Debug.WriteLine(result);{{/returnType}} } catch (ApiException e) @@ -96,7 +96,7 @@ namespace Example {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/csharp/compile.mustache b/modules/openapi-generator/src/main/resources/csharp/compile.mustache index f80911357fd2..920ce2c2427d 100644 --- a/modules/openapi-generator/src/main/resources/csharp/compile.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/compile.mustache @@ -24,4 +24,3 @@ copy packages\PropertyChanged.Fody.{{propertychanged-fody.version}}\PropertyChan copy packages\PropertyChanged.Fody.{{propertychanged-fody.version}}\Lib\dotnet\PropertyChanged.dll bin\PropertyChanged.dll {{/generatePropertyChanged}} %CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml - diff --git a/modules/openapi-generator/src/main/resources/csharp/enumClass.mustache b/modules/openapi-generator/src/main/resources/csharp/enumClass.mustache index de8c602a14dc..ee1d5a1885ae 100644 --- a/modules/openapi-generator/src/main/resources/csharp/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/enumClass.mustache @@ -1,11 +1,11 @@ /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} [JsonConverter(typeof(StringEnumConverter))] - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/csharp/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/csharp/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100755 --- a/modules/openapi-generator/src/main/resources/csharp/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/csharp/modelEnum.mustache b/modules/openapi-generator/src/main/resources/csharp/modelEnum.mustache index c1a70a37f2dd..91be597da01a 100644 --- a/modules/openapi-generator/src/main/resources/csharp/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/modelEnum.mustache @@ -1,13 +1,13 @@ /// - /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}} [JsonConverter(typeof(StringEnumConverter))] {{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}} - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache index 933ba0824aeb..bf8b1de91b3e 100644 --- a/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache @@ -1,5 +1,5 @@ /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// [DataContract] {{#discriminator}} @@ -9,7 +9,7 @@ {{#generatePropertyChanged}} [ImplementPropertyChanged] {{/generatePropertyChanged}} - {{>visibility}} partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>{{^netStandard}}{{#validatable}}, IValidatableObject{{/validatable}}{{/netStandard}} + {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}} IEquatable<{{classname}}>{{^netStandard}}{{#validatable}}, IValidatableObject{{/validatable}}{{/netStandard}} { {{#vars}} {{#items.isEnum}} @@ -26,16 +26,16 @@ {{/isEnum}} {{#isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}{{#required}}true{{/required}}{{^required}}false{{/required}}{{/isNullable}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} [Obsolete] {{/deprecated}} - public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } {{/isEnum}} {{/vars}} {{#hasRequired}} @@ -52,13 +52,13 @@ /// {{#vars}} {{^isReadOnly}} - /// {{#description}}{{description}}{{/description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}. + /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. {{/isReadOnly}} {{/vars}} {{#hasOnlyReadOnly}} [JsonConstructorAttribute] {{/hasOnlyReadOnly}} - public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} + public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{{defaultValue}}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} { {{#vars}} {{^isInherited}} @@ -108,9 +108,9 @@ this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; {{^isInherited}} {{^isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}}{{/description}} + /// {{.}}{{/description}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}{{#required}}true{{/required}}{{^required}}false{{/required}}{{/isNullable}}{{/vendorExtensions.x-emit-default-value}})]{{#isDate}} [JsonConverter(typeof(OpenAPIDateConverter))]{{/isDate}} {{#deprecated}} @@ -302,7 +302,7 @@ this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; } {{/minLength}} {{/isEnum}} - + {{#maximum}} // {{{name}}} ({{{dataType}}}) maximum if(this.{{{name}}} > ({{{dataType}}}){{maximum}}) diff --git a/modules/openapi-generator/src/main/resources/csharp/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/csharp/modelInnerEnum.mustache index d9e96dccdb3c..4187d95bd049 100644 --- a/modules/openapi-generator/src/main/resources/csharp/modelInnerEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/modelInnerEnum.mustache @@ -1,14 +1,14 @@ {{^isContainer}} /// - /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} {{#isString}} [JsonConverter(typeof(StringEnumConverter))] {{/isString}} - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/csharp/nuspec.mustache b/modules/openapi-generator/src/main/resources/csharp/nuspec.mustache index 45ba3381de63..623a37f91440 100644 --- a/modules/openapi-generator/src/main/resources/csharp/nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/nuspec.mustache @@ -21,10 +21,10 @@ nuget.org gallery uses information you add in the portal. --> {{packageDescription}} {{#termsOfService}} - {{termsOfService}} + {{.}} {{/termsOfService}} {{#licenseUrl}} - {{licenseUrl}} + {{.}} {{/licenseUrl}} diff --git a/modules/openapi-generator/src/main/resources/csharp/partial_header.mustache b/modules/openapi-generator/src/main/resources/csharp/partial_header.mustache index 8c6a0fc032a4..2c741c79595a 100644 --- a/modules/openapi-generator/src/main/resources/csharp/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/partial_header.mustache @@ -1,13 +1,13 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/modules/openapi-generator/src/main/resources/dart-dio/README.mustache b/modules/openapi-generator/src/main/resources/dart-dio/README.mustache index 0b375af727d9..e76a9e8b63a3 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/README.mustache @@ -1,13 +1,13 @@ # {{pubName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} {{#artifactVersion}} -- Package version: {{artifactVersion}} +- Package version: {{.}} {{/artifactVersion}} {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} @@ -73,7 +73,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models @@ -107,4 +107,3 @@ Class | Method | HTTP request | Description {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache index 522815498c5c..3feee9161932 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache @@ -19,7 +19,7 @@ class {{classname}} { /// {{{summary}}} /// /// {{{notes}}} - Future> {{nickname}}({{^hasRequiredParams}}{ {{/hasRequiredParams}}{{#requiredParams}} + Future> {{nickname}}({{^hasRequiredParams}}{ {{/hasRequiredParams}}{{#requiredParams}} {{{dataType}}} {{paramName}},{{#-last}} { {{/-last}}{{/requiredParams}}{{#optionalParams}} {{{dataType}}} {{paramName}},{{/optionalParams}} CancelToken cancelToken, diff --git a/modules/openapi-generator/src/main/resources/dart-dio/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart-dio/api_doc.mustache index 1e28b16012e4..ff0dd731eebb 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/api_doc.mustache @@ -1,5 +1,5 @@ # {{pubName}}.api.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} ## Load the API package ```dart @@ -10,19 +10,19 @@ All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} -### Example +### Example ```dart import 'package:{{pubName}}/api.dart'; {{#hasAuthMethods}} @@ -50,7 +50,7 @@ var api_instance = new {{classname}}(); var {{paramName}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}new {{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} {{/allParams}} -try { +try { {{#returnType}}var result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#returnType}} print(result); @@ -64,7 +64,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{baseType}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{baseType}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/dart-dio/api_test.mustache b/modules/openapi-generator/src/main/resources/dart-dio/api_test.mustache index f4dd8e65fad8..2ea19b30c81d 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/api_test.mustache @@ -19,7 +19,7 @@ void main() { // {{{.}}} // {{/notes}} - //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async test('test {{{operationId}}}', () async { // TODO }); diff --git a/modules/openapi-generator/src/main/resources/dart-dio/class.mustache b/modules/openapi-generator/src/main/resources/dart-dio/class.mustache index 0fce16365a32..f4d2c1e4e76d 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/class.mustache @@ -7,7 +7,7 @@ abstract class {{classname}} implements Built<{{classname}}, {{classname}}Builde {{#vars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} {{! A field is @nullable in built_value when it is diff --git a/modules/openapi-generator/src/main/resources/dart-dio/enum.mustache b/modules/openapi-generator/src/main/resources/dart-dio/enum.mustache index 35049426b9e6..16ab3eeb243b 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/enum.mustache @@ -9,7 +9,7 @@ class {{classname}} extends EnumClass { {{#allowableValues}} {{#enumVars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{^isInteger}}wireName: r{{#lambda.escapeBuiltValueEnum}}{{{value}}}{{/lambda.escapeBuiltValueEnum}}{{/isInteger}}) static const {{classname}} {{name}} = _${{name}}; diff --git a/modules/openapi-generator/src/main/resources/dart-dio/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart-dio/enum_inline.mustache index f18008d92bf0..d9432ae28f00 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/enum_inline.mustache @@ -3,7 +3,7 @@ class {{{enumName}}} extends EnumClass { {{#allowableValues}} {{#enumVars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{^isInteger}}wireName: r{{#lambda.escapeBuiltValueEnum}}{{{value}}}{{/lambda.escapeBuiltValueEnum}}{{/isInteger}}) static const {{{enumName}}} {{name}} = _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}_{{name}}; diff --git a/modules/openapi-generator/src/main/resources/dart-dio/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart-dio/gitignore.mustache index 6d2ac22c0b41..4298cdcbd1a2 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/gitignore.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/gitignore.mustache @@ -10,7 +10,7 @@ build/ **/packages/ # Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these +# (Most Dart developers will use pub build to compile Dart, use/modify these # rules if you intend to use dart2js directly # Convention is to use extension '.dart.js' for Dart compiled to Javascript to # differentiate from explicit Javascript files) @@ -23,7 +23,7 @@ build/ # Directory created by dartdoc doc/api/ -# Don't commit pubspec lock file +# Don't commit pubspec lock file # (Library packages only! Remove pattern if developing an application package) pubspec.lock diff --git a/modules/openapi-generator/src/main/resources/dart-dio/model_test.mustache b/modules/openapi-generator/src/main/resources/dart-dio/model_test.mustache index e9aab10347ec..9cd8f2a9c970 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/model_test.mustache @@ -15,7 +15,7 @@ void main() { group({{{classname}}}, () { {{#vars}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} // {{{dataType}}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} test('to test the property `{{{name}}}`', () async { diff --git a/modules/openapi-generator/src/main/resources/dart-dio/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart-dio/object_doc.mustache index f2a52db11a4b..cb6505fcf4ec 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/object_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/object_doc.mustache @@ -8,7 +8,7 @@ import 'package:{{pubName}}/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache index 3e2d427c4d42..9296cc859046 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache @@ -1,13 +1,13 @@ # {{pubName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: - API version: {{appVersion}} {{#artifactVersion}} -- Package version: {{artifactVersion}} +- Package version: {{.}} {{/artifactVersion}} {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} @@ -105,7 +105,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models @@ -139,4 +139,3 @@ Class | Method | HTTP request | Description {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache index db992b6faf7f..7aef336eda4b 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache @@ -25,7 +25,7 @@ class {{classname}} extends ApiClient with _${{classname}}Client { /// /// {{notes}} @{{httpMethod}}Req(path: "{{path}}"{{#hasAuthMethods}}, metadata: {"auth": [{{#authMethods}} {"type": "{{type}}", "name": "{{name}}"{{#isApiKey}}, "keyName": "{{keyParamName}}", "where": "{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}"{{/isApiKey}} }{{^-last}}, {{/-last}}{{/authMethods}}]}{{/hasAuthMethods}}) - Future<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{nickname}}( + Future<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{nickname}}( {{#pathParams}} @PathParam("{{baseName}}") {{dataType}} {{paramName}}{{^-last}}, {{/-last}} {{/pathParams}} diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/api_doc.mustache index 243e2486755c..ad0c61a6673f 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/api_doc.mustache @@ -1,5 +1,5 @@ # {{pubName}}.api.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} ## Load the API package ```dart @@ -10,19 +10,19 @@ All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} -### Example +### Example ```dart import 'package:{{pubName}}/api.dart'; {{#hasAuthMethods}} @@ -50,7 +50,7 @@ var api_instance = new {{classname}}(); var {{paramName}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}new {{dataType}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} {{/allParams}} -try { +try { {{#returnType}}var result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#returnType}} print(result); @@ -64,7 +64,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/api_test.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/api_test.mustache index f5211efaff22..d44b5bdef2f2 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/api_test.mustache @@ -17,7 +17,7 @@ void main() { // {{{.}}} // {{/notes}} - //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{operationId}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{operationId}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async test('test {{operationId}}', () async { // TODO }); diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache index 0bb3c1067448..6178bba374fb 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache @@ -9,7 +9,7 @@ message {{classname}} { part '{{classFilename}}.jser.dart'; class {{classname}} { - {{#vars}}{{#description}} /* {{{description}}} */{{/description}} + {{#vars}}{{#description}} /* {{{.}}} */{{/description}} @Alias('{{{baseName}}}', isNullable:{{#isNullable}} true{{/isNullable}}{{^isNullable}} false{{/isNullable}},{{#allowableValues}} {{^enumVars.empty}}{{^isString}}{{! isString because inline enums are not handled for now }} processor: const {{{datatype}}}FieldProcessor(), diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache index ef2c35e2c2ad..da8322afbe9f 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache @@ -9,7 +9,7 @@ class {{classname}} { {{#allowableValues}} {{#enumVars}} {{#description}} - /// {{description}} + /// {{.}} {{/description}} static const {{classname}} {{{name}}} = const {{classname}}._internal({{{value}}}); {{/enumVars}} diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100755 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/gitignore.mustache index 7c2804416498..8b7331fd822c 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/gitignore.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/gitignore.mustache @@ -9,7 +9,7 @@ build/ **/packages/ # Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these +# (Most Dart developers will use pub build to compile Dart, use/modify these # rules if you intend to use dart2js directly # Convention is to use extension '.dart.js' for Dart compiled to Javascript to # differentiate from explicit Javascript files) @@ -22,6 +22,6 @@ build/ # Directory created by dartdoc doc/api/ -# Don't commit pubspec lock file +# Don't commit pubspec lock file # (Library packages only! Remove pattern if developing an application package) pubspec.lock diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/model_test.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/model_test.mustache index b766bf143e78..8e36f3df9a2f 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/model_test.mustache @@ -10,7 +10,7 @@ void main() { group('test {{classname}}', () { {{#vars}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} // {{{dataType}}} {{name}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} test('to test the property `{{name}}`', () async { diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/object_doc.mustache index 793c8df8ae02..ee17fcd02274 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/object_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/object_doc.mustache @@ -8,7 +8,7 @@ import 'package:{{pubName}}/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache index 69591ce24a3c..3efaca1cb660 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache @@ -1,13 +1,13 @@ # {{pubName}} (EXPERIMENTAL) {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} {{#artifactVersion}} -- Package version: {{artifactVersion}} +- Package version: {{.}} {{/artifactVersion}} {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} @@ -82,7 +82,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}[*{{classname}}*]({{modelDocPath}}{{{classname}}}.md) | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}[*{{classname}}*]({{modelDocPath}}{{{classname}}}.md) | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models @@ -116,4 +116,3 @@ Class | Method | HTTP request | Description {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache index bcb912d6c268..01663cfd23c2 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache @@ -19,7 +19,7 @@ class {{classname}} { const {{classname}}(this._dio{{#useBuiltValue}}, this._serializers{{/useBuiltValue}}); {{#operation}} - /// {{#summary}}{{.}}{{/summary}}{{^summary}}{{nickname}}{{/summary}} + /// {{summary}}{{^summary}}{{nickname}}{{/summary}} /// {{notes}} /// /// Parameters: @@ -33,7 +33,7 @@ class {{classname}} { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// - /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{returnType}}}] as data{{/returnType}} + /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} /// Throws [DioError] if API call or serialization fails {{#externalDocs}} /// {{description}} @@ -42,12 +42,12 @@ class {{classname}} { {{#isDeprecated}} @Deprecated('This operation has been deprecated') {{/isDeprecated}} - Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} + Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} - {{#required}}required {{/required}}{{{dataType}}}{{^required}}?{{/required}} {{paramName}},{{/isQueryParam}}{{#isHeaderParam}} - {{#required}}required {{/required}}{{{dataType}}}{{^required}}?{{/required}} {{paramName}},{{/isHeaderParam}}{{#isBodyParam}} - {{#required}}required {{/required}}{{{dataType}}}{{^required}}?{{/required}} {{paramName}},{{/isBodyParam}}{{#isFormParam}} - {{#required}}required {{/required}}{{{dataType}}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} + {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isQueryParam}}{{#isHeaderParam}} + {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isHeaderParam}}{{#isBodyParam}} + {{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isBodyParam}}{{#isFormParam}} + {{#required}}{{^isNullable}}required {{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}},{{/isFormParam}}{{/allParams}} CancelToken? cancelToken, Map? headers, Map? extra, @@ -74,7 +74,7 @@ class {{classname}} { 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} {{#authMethods}}{ 'type': '{{type}}',{{#scheme}} - 'scheme': '{{scheme}}',{{/scheme}} + 'scheme': '{{.}}',{{/scheme}} 'name': '{{name}}',{{#isApiKey}} 'keyName': '{{keyParamName}}', 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache index 548c8b140ce2..39e9163d75d8 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache @@ -1,5 +1,5 @@ # {{pubName}}.api.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} ## Load the API package ```dart @@ -10,19 +10,19 @@ All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} -### Example +### Example ```dart import 'package:{{pubName}}/api.dart'; {{#hasAuthMethods}} @@ -50,7 +50,7 @@ final api = {{clientName}}().get{{classname}}(); final {{{dataType}}} {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} -try { +try { {{#returnType}}final response = {{/returnType}}api.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#returnType}} print(response); @@ -64,7 +64,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache index 056920d91aa1..8420ac5dfaf7 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache @@ -17,7 +17,7 @@ void main() { // {{{.}}} // {{/notes}} - //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async test('test {{{operationId}}}', () async { // TODO }); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/gitignore.mustache index 6d2ac22c0b41..4298cdcbd1a2 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/gitignore.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/gitignore.mustache @@ -10,7 +10,7 @@ build/ **/packages/ # Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these +# (Most Dart developers will use pub build to compile Dart, use/modify these # rules if you intend to use dart2js directly # Convention is to use extension '.dart.js' for Dart compiled to Javascript to # differentiate from explicit Javascript files) @@ -23,7 +23,7 @@ build/ # Directory created by dartdoc doc/api/ -# Don't commit pubspec lock file +# Don't commit pubspec lock file # (Library packages only! Remove pattern if developing an application package) pubspec.lock diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache index eaa57022a416..56686dc889aa 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache @@ -14,7 +14,7 @@ void main() { group({{{classname}}}, () { {{#vars}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} // {{{dataType}}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} test('to test the property `{{{name}}}`', () async { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache index 84b70087bf48..9abc25d51235 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache @@ -8,7 +8,7 @@ import 'package:{{pubName}}/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache index 816524bc73af..1c5937091013 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache @@ -11,7 +11,7 @@ part '{{classFilename}}.g.dart'; // ignore_for_file: unused_import {{/parentModel}} -/// {{#description}}{{{.}}}{{/description}}{{^description}}{{classname}}{{/description}} +/// {{{description}}}{{^description}}{{classname}}{{/description}} {{#hasVars}} /// /// Properties: @@ -22,7 +22,7 @@ part '{{classFilename}}.g.dart'; abstract class {{classname}} implements Built<{{classname}}, {{classname}}Builder> { {{#vars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} @BuiltValueField(wireName: r'{{baseName}}') {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^required}}?{{/required}}{{/isNullable}} get {{name}}; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache index 4e299b1faa3b..e3cc6755362e 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache @@ -9,7 +9,7 @@ class {{classname}} extends EnumClass { {{#allowableValues}} {{#enumVars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{^isInteger}}wireName: r{{{value}}}{{/isInteger}}) static const {{classname}} {{name}} = _${{name}}; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache index 2d0c898cd3c9..5f5dfd499135 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache @@ -3,7 +3,7 @@ class {{{enumName}}} extends EnumClass { {{#allowableValues}} {{#enumVars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{^isInteger}}wireName: r{{{value}}}{{/isInteger}}) static const {{{enumName}}} {{name}} = _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}_{{name}}; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/query_param.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/query_param.mustache index 06599a5ab4a9..aa47f4f43940 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/query_param.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/query_param.mustache @@ -1 +1 @@ -{{#isContainer}}encodeCollectionQueryParameter<{{{baseType}}}>{{/isContainer}}{{^isContainer}}encodeQueryParameter{{/isContainer}}(_serializers, {{{paramName}}}, const FullType({{^isContainer}}{{{dataType}}}){{/isContainer}}{{#isContainer}}Built{{#isMap}}Map{{/isMap}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{baseType}}})]), {{#collectionFormat}}format: ListFormat.{{collectionFormat}},{{/collectionFormat}}{{/isContainer}}) \ No newline at end of file +{{#isContainer}}{{#isMap}}encodeQueryParameter{{/isMap}}{{^isMap}}encodeCollectionQueryParameter<{{{baseType}}}>{{/isMap}}{{/isContainer}}{{^isContainer}}encodeQueryParameter{{/isContainer}}(_serializers, {{{paramName}}}, const FullType({{^isContainer}}{{{dataType}}}){{/isContainer}}{{#isContainer}}Built{{#isMap}}Map{{/isMap}}{{#isArray}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}List{{/uniqueItems}}{{/isArray}}, [{{#isMap}}FullType(String), {{/isMap}}FullType({{{baseType}}})]), {{#collectionFormat}}format: ListFormat.{{collectionFormat}},{{/collectionFormat}}{{/isContainer}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serialize.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serialize.mustache index d876fe2979bb..54d8e99c7579 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serialize.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/serialize.mustache @@ -16,7 +16,7 @@ {{/hasFormParams}} {{#bodyParam}} {{#isPrimitiveType}} - _bodyData = {{paramName}}{{#isFile}}.finalize(){{/isFile}}; + _bodyData = {{paramName}}{{#isFile}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}.finalize(){{/isFile}}; {{/isPrimitiveType}} {{^isPrimitiveType}} {{#isContainer}} diff --git a/modules/openapi-generator/src/main/resources/dart2/README.mustache b/modules/openapi-generator/src/main/resources/dart2/README.mustache index 01718999fd2b..1b1129159560 100644 --- a/modules/openapi-generator/src/main/resources/dart2/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/README.mustache @@ -1,13 +1,13 @@ # {{{pubName}}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{{appVersion}}} {{#artifactVersion}} -- Package version: {{{artifactVersion}}} +- Package version: {{{.}}} {{/artifactVersion}} {{^hideGenerationTimestamp}} - Build date: {{{generatedDate}}} @@ -102,7 +102,7 @@ All URIs are relative to *{{{basePath}}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{{classname}}}* | [**{{{operationId}}}**]({{{apiDocPath}}}/{{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{#summary}}{{{summary}}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{{classname}}}* | [**{{{operationId}}}**]({{{apiDocPath}}}/{{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{{summary}}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models @@ -142,4 +142,3 @@ Class | Method | HTTP request | Description {{#apiInfo}}{{#apis}}{{#-last}}{{{infoEmail}}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/dart2/api.mustache b/modules/openapi-generator/src/main/resources/dart2/api.mustache index a7bb92891431..b86bdb022288 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api.mustache @@ -9,7 +9,7 @@ class {{{classname}}} { {{#operation}} {{#summary}} - /// {{{summary}}} + /// {{{.}}} {{/summary}} {{#notes}} {{#summary}} @@ -43,7 +43,7 @@ class {{{classname}}} { {{#allParams}} /// * [{{{dataType}}}] {{{paramName}}}{{#required}} (required){{/required}}{{#optional}} (optional){{/optional}}: {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} {{^-last}} /// @@ -144,7 +144,7 @@ class {{{classname}}} { } {{#summary}} - /// {{{summary}}} + /// {{{.}}} {{/summary}} {{#notes}} {{#summary}} @@ -167,13 +167,13 @@ class {{{classname}}} { {{#allParams}} /// * [{{{dataType}}}] {{{paramName}}}{{#required}} (required){{/required}}{{#optional}} (optional){{/optional}}: {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} {{^-last}} /// {{/-last}} {{/allParams}} - Future<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{{nickname}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { + Future<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{{nickname}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { final response = await {{{nickname}}}WithHttpInfo({{#allParams}}{{#required}}{{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}} {{#allParams}}{{^required}}{{{paramName}}}: {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} {{/hasOptionalParams}}); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); diff --git a/modules/openapi-generator/src/main/resources/dart2/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart2/api_doc.mustache index b7e91eb72c85..3332ff1f205d 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api_doc.mustache @@ -1,5 +1,5 @@ # {{{pubName}}}.api.{{{classname}}}{{#description}} -{{{description}}}{{/description}} +{{{.}}}{{/description}} ## Load the API package ```dart @@ -10,19 +10,19 @@ All URIs are relative to *{{{basePath}}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{{operationId}}}**]({{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{#summary}}{{{summary}}}{{/summary}} +{{#operations}}{{#operation}}[**{{{operationId}}}**]({{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{{summary}}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} -### Example +### Example ```dart import 'package:{{{pubName}}}/api.dart'; {{#hasAuthMethods}} @@ -60,7 +60,7 @@ final api_instance = {{{classname}}}(); final {{{paramName}}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}{{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} {{/allParams}} -try { +try { {{#returnType}}final result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); {{#returnType}} print(result); @@ -74,7 +74,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{{paramName}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{baseType}}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{#allParams}} **{{{paramName}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{baseType}}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/dart2/api_test.mustache b/modules/openapi-generator/src/main/resources/dart2/api_test.mustache index eb0aeb076436..319945b2c3b5 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api_test.mustache @@ -18,7 +18,7 @@ void main() { // {{{.}}} // {{/notes}} - //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async test('test {{{operationId}}}', () async { // TODO }); diff --git a/modules/openapi-generator/src/main/resources/dart2/apilib.mustache b/modules/openapi-generator/src/main/resources/dart2/apilib.mustache index df10d8040110..e2233d95ec49 100644 --- a/modules/openapi-generator/src/main/resources/dart2/apilib.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/apilib.mustache @@ -1,5 +1,5 @@ {{>header}} -{{#pubLibrary}}library {{{pubLibrary}}};{{/pubLibrary}}{{^pubLibrary}}library {{{pubName}}}.api;{{/pubLibrary}} +{{#pubLibrary}}library {{{.}}};{{/pubLibrary}}{{^pubLibrary}}library {{{pubName}}}.api;{{/pubLibrary}} import 'dart:async'; import 'dart:convert'; diff --git a/modules/openapi-generator/src/main/resources/dart2/auth/part_of.mustache b/modules/openapi-generator/src/main/resources/dart2/auth/part_of.mustache index d9f1d409755c..d31ade250360 100644 --- a/modules/openapi-generator/src/main/resources/dart2/auth/part_of.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/auth/part_of.mustache @@ -1 +1 @@ -{{#pubLibrary}}part of {{{pubLibrary}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} +{{#pubLibrary}}part of {{{.}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} diff --git a/modules/openapi-generator/src/main/resources/dart2/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/dart2/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100755 --- a/modules/openapi-generator/src/main/resources/dart2/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/dart2/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart2/gitignore.mustache index 7c2804416498..8b7331fd822c 100644 --- a/modules/openapi-generator/src/main/resources/dart2/gitignore.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/gitignore.mustache @@ -9,7 +9,7 @@ build/ **/packages/ # Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these +# (Most Dart developers will use pub build to compile Dart, use/modify these # rules if you intend to use dart2js directly # Convention is to use extension '.dart.js' for Dart compiled to Javascript to # differentiate from explicit Javascript files) @@ -22,6 +22,6 @@ build/ # Directory created by dartdoc doc/api/ -# Don't commit pubspec lock file +# Don't commit pubspec lock file # (Library packages only! Remove pattern if developing an application package) pubspec.lock diff --git a/modules/openapi-generator/src/main/resources/dart2/model_test.mustache b/modules/openapi-generator/src/main/resources/dart2/model_test.mustache index 7de9c7b840ea..5d4f1c161c52 100644 --- a/modules/openapi-generator/src/main/resources/dart2/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/model_test.mustache @@ -13,7 +13,7 @@ void main() { group('test {{{classname}}}', () { {{#vars}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} // {{{dataType}}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} test('to test the property `{{{name}}}`', () async { diff --git a/modules/openapi-generator/src/main/resources/dart2/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart2/object_doc.mustache index 94402b858e0d..441b2c7bd1bb 100644 --- a/modules/openapi-generator/src/main/resources/dart2/object_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/object_doc.mustache @@ -8,7 +8,7 @@ import 'package:{{{pubName}}}/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{{name}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{complexType}}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{#vars}}**{{{name}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{complexType}}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/dart2/part_of.mustache b/modules/openapi-generator/src/main/resources/dart2/part_of.mustache index d9f1d409755c..d31ade250360 100644 --- a/modules/openapi-generator/src/main/resources/dart2/part_of.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/part_of.mustache @@ -1 +1 @@ -{{#pubLibrary}}part of {{{pubLibrary}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} +{{#pubLibrary}}part of {{{.}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} diff --git a/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_class.mustache b/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_class.mustache index 3a9ff0362b33..f3c1ba77cb60 100644 --- a/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_class.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_class.mustache @@ -9,19 +9,19 @@ class {{{classname}}} { {{#vars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} {{^isEnum}} {{#minimum}} - // minimum: {{{minimum}}} + // minimum: {{{.}}} {{/minimum}} {{#maximum}} - // maximum: {{{maximum}}} + // maximum: {{{.}}} {{/maximum}} {{/isEnum}} {{^isBinary}} @JsonKey( - {{#defaultValue}}defaultValue: {{{defaultValue}}},{{/defaultValue}}{{^defaultValue}}nullable: {{isNullable}},{{/defaultValue}} + {{#defaultValue}}defaultValue: {{{.}}},{{/defaultValue}}{{^defaultValue}}nullable: {{isNullable}},{{/defaultValue}} name: r'{{{baseName}}}', required: {{#required}}true{{/required}}{{^required}}false{{/required}}, ) diff --git a/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_enum_inline.mustache index 5249f86b398e..6e9f9016750b 100644 --- a/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_enum_inline.mustache @@ -1,4 +1,4 @@ -{{#description}}/// {{{description}}}{{/description}} +{{#description}}/// {{{.}}}{{/description}} enum {{{enumName}}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache index 1d599915a0ad..396236bd6f59 100644 --- a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache @@ -3,14 +3,14 @@ class {{{classname}}} { {{#vars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} {{^isEnum}} {{#minimum}} - // minimum: {{{minimum}}} + // minimum: {{{.}}} {{/minimum}} {{#maximum}} - // maximum: {{{maximum}}} + // maximum: {{{.}}} {{/maximum}} {{/isEnum}} {{{datatypeWithEnum}}} {{{name}}}; diff --git a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum.mustache b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum.mustache index d3ba3f350a80..e9c7e5d2d720 100644 --- a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum.mustache @@ -1,4 +1,4 @@ -{{#description}}/// {{{description}}}{{/description}} +{{#description}}/// {{{.}}}{{/description}} class {{{classname}}} { /// Instantiate a new enum with the provided [value]. const {{{classname}}}._(this.value); diff --git a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum_inline.mustache index d14c5a5648a0..139f4d028798 100644 --- a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum_inline.mustache @@ -1,4 +1,4 @@ -{{#description}}/// {{{description}}}{{/description}} +{{#description}}/// {{{.}}}{{/description}} class {{{enumName}}} { /// Instantiate a new enum with the provided [value]. const {{{enumName}}}._(this.value); diff --git a/modules/openapi-generator/src/main/resources/elixir/api.mustache b/modules/openapi-generator/src/main/resources/elixir/api.mustache index 7979112f5604..eb923cb39204 100644 --- a/modules/openapi-generator/src/main/resources/elixir/api.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/api.mustache @@ -35,7 +35,7 @@ defmodule {{moduleName}}.Api.{{classname}} do {{/optionalParams}} ## Returns - {:ok, {{#isArray}}[%{{&returnBaseType}}{}, ...]{{/isArray}}{{#isMap}}%{}{{/isMap}}{{^returnType}}nil{{/returnType}}{{#returnSimpleType}}{{#returnType}}{{#isMap}}{{/isMap}}{{{returnType}}}{{/returnType}}{{/returnSimpleType}}} on success + {:ok, {{#isArray}}[%{{&returnBaseType}}{}, ...]{{/isArray}}{{#isMap}}%{}{{/isMap}}{{^returnType}}nil{{/returnType}}{{#returnSimpleType}}{{#returnType}}{{{.}}}{{/returnType}}{{/returnSimpleType}}} on success {:error, Tesla.Env.t} on failure """ {{{typespec}}} diff --git a/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache b/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache index 801049004637..fe86fe1f06b7 100644 --- a/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache @@ -16,7 +16,7 @@ defmodule {{moduleName}}.Connection do {{#isOAuth}} @scopes [ {{#scopes}} - "{{scope}}"{{^-last}},{{/-last}} {{#description}}# {{description}}{{/description}} + "{{scope}}"{{^-last}},{{/-last}} {{#description}}# {{.}}{{/description}} {{/scopes}} ] diff --git a/modules/openapi-generator/src/main/resources/elixir/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/elixir/licenseInfo.mustache index b364930dee93..6e4e7a44c6c7 100644 --- a/modules/openapi-generator/src/main/resources/elixir/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/licenseInfo.mustache @@ -1,4 +1,4 @@ -{{#licenseHeader}}{{licenseHeader}} +{{#licenseHeader}}{{.}} {{/licenseHeader}} # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/modules/openapi-generator/src/main/resources/elm/README.mustache b/modules/openapi-generator/src/main/resources/elm/README.mustache index 932f287c0fae..36be424bcdaa 100644 --- a/modules/openapi-generator/src/main/resources/elm/README.mustache +++ b/modules/openapi-generator/src/main/resources/elm/README.mustache @@ -1,7 +1,7 @@ # Elm API client {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview diff --git a/modules/openapi-generator/src/main/resources/elm/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/elm/licenseInfo.mustache index 19a72ee62407..9ee1c264742e 100644 --- a/modules/openapi-generator/src/main/resources/elm/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/elm/licenseInfo.mustache @@ -3,10 +3,10 @@ {{{appDescription}}} {{#version}} - The version of the OpenAPI document: {{{version}}} + The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} - Contact: {{{infoEmail}}} + Contact: {{{.}}} {{/infoEmail}} NOTE: This file is auto generated by the openapi-generator. diff --git a/modules/openapi-generator/src/main/resources/elm/operation.mustache b/modules/openapi-generator/src/main/resources/elm/operation.mustache index de4d54d17982..496e7954f69f 100644 --- a/modules/openapi-generator/src/main/resources/elm/operation.mustache +++ b/modules/openapi-generator/src/main/resources/elm/operation.mustache @@ -33,7 +33,7 @@ import Uuid exposing (Uuid){{/includeUuid}} {-| {{{notes}}} -} {{/notes}} -{{operationId}} : {{#allParams}}{{^required}}Maybe {{/required}}{{#isArray}}List {{/isArray}}{{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{#isModel}}Api.Data.{{/isModel}}{{dataType}}{{/datatypeWithEnum}} -> {{/allParams}}{{#authMethods}}{{#isBasicBearer}}String -> {{/isBasicBearer}}{{/authMethods}}Api.Request {{^responses}}(){{/responses}}{{#responses}}{{#is2xx}}{{^dataType}}(){{/dataType}}{{#isMap}}(Dict.Dict String {{/isMap}}{{#isArray}}(List {{#items}}{{#isModel}}Api.Data.{{/isModel}}{{/items}}{{/isArray}}{{^isArray}}{{^primitiveType}}{{^isUuid}}Api.Data.{{/isUuid}}{{/primitiveType}}{{/isArray}}{{dataType}}{{#isArray}}){{/isArray}}{{#isMap}}){{/isMap}}{{/is2xx}}{{/responses}} +{{operationId}} : {{#allParams}}{{^required}}Maybe {{/required}}{{#isArray}}List {{/isArray}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{#isModel}}Api.Data.{{/isModel}}{{dataType}}{{/datatypeWithEnum}} -> {{/allParams}}{{#authMethods}}{{#isBasicBearer}}String -> {{/isBasicBearer}}{{/authMethods}}Api.Request {{^responses}}(){{/responses}}{{#responses}}{{#is2xx}}{{^dataType}}(){{/dataType}}{{#isMap}}(Dict.Dict String {{/isMap}}{{#isArray}}(List {{#items}}{{#isModel}}Api.Data.{{/isModel}}{{/items}}{{/isArray}}{{^isArray}}{{^primitiveType}}{{^isUuid}}Api.Data.{{/isUuid}}{{/primitiveType}}{{/isArray}}{{dataType}}{{#isArray}}){{/isArray}}{{#isMap}}){{/isMap}}{{/is2xx}}{{/responses}} {{operationId}}{{#allParams}} {{>paramName}}{{/allParams}}{{#authMethods}}{{#isBasicBearer}} auth_token{{/isBasicBearer}}{{/authMethods}} = Api.request "{{httpMethod}}" diff --git a/modules/openapi-generator/src/main/resources/erlang-client/api.mustache b/modules/openapi-generator/src/main/resources/erlang-client/api.mustache index ddb5dee01389..3d7162eca51a 100644 --- a/modules/openapi-generator/src/main/resources/erlang-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-client/api.mustache @@ -11,11 +11,11 @@ {{^notes.isEmpty}} %% {{{notes}}} {{/notes.isEmpty}} --spec {{operationId}}(ctx:ctx(){{#allParams}}{{#required}}, {{{dataType}}}{{/required}}{{/allParams}}) -> {ok, {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}[]{{/returnType}}, {{packageName}}_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), {{packageName}}_utils:response_info()}. +-spec {{operationId}}(ctx:ctx(){{#allParams}}{{#required}}, {{{dataType}}}{{/required}}{{/allParams}}) -> {ok, {{{returnType}}}{{^returnType}}[]{{/returnType}}, {{packageName}}_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), {{packageName}}_utils:response_info()}. {{operationId}}(Ctx{{#allParams}}{{#required}}, {{paramName}}{{/required}}{{/allParams}}) -> {{operationId}}(Ctx{{#allParams}}{{#required}}, {{paramName}}{{/required}}{{/allParams}}, #{}). --spec {{operationId}}(ctx:ctx(){{#allParams}}{{#required}}, {{{dataType}}}{{/required}}{{/allParams}}, maps:map()) -> {ok, {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}[]{{/returnType}}, {{packageName}}_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), {{packageName}}_utils:response_info()}. +-spec {{operationId}}(ctx:ctx(){{#allParams}}{{#required}}, {{{dataType}}}{{/required}}{{/allParams}}, maps:map()) -> {ok, {{{returnType}}}{{^returnType}}[]{{/returnType}}, {{packageName}}_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), {{packageName}}_utils:response_info()}. {{operationId}}(Ctx{{#allParams}}{{#required}}, {{paramName}}{{/required}}{{/allParams}}, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), diff --git a/modules/openapi-generator/src/main/resources/erlang-client/app.src.mustache b/modules/openapi-generator/src/main/resources/erlang-client/app.src.mustache index 7d9dc3f55fe6..f41c881524a5 100644 --- a/modules/openapi-generator/src/main/resources/erlang-client/app.src.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-client/app.src.mustache @@ -1,6 +1,6 @@ {application, {{packageName}}, - [{description, {{#appDescription}}"{{appDescription}}"{{/appDescription}}{{^appDescription}}"OpenAPI client library"{{/appDescription}}}, - {vsn, "{{#apiVersion}}{{apiVersion}}{{/apiVersion}}{{^apiVersion}}0.1.0{{/apiVersion}}"}, + [{description, {{#appDescription}}"{{.}}"{{/appDescription}}{{^appDescription}}"OpenAPI client library"{{/appDescription}}}, + {vsn, "{{apiVersion}}{{^apiVersion}}0.1.0{{/apiVersion}}"}, {registered, []}, {applications, [kernel, @@ -9,10 +9,10 @@ hackney, ctx ]}, - {env, [{host, "{{#host}}{{{host}}}{{/host}}{{^host}}localhost{{/host}}"}]}, + {env, [{host, "{{{host}}}{{^host}}localhost{{/host}}"}]}, {modules, []}, {maintainers, []}, - {licenses, [{{#licenseInfo}}"{{licenseInfo}}"{{/licenseInfo}}]}, - {links, [{{#infoUrl}}"{{infoUrl}}"{{/infoUrl}}]} + {licenses, [{{#licenseInfo}}"{{.}}"{{/licenseInfo}}]}, + {links, [{{#infoUrl}}"{{.}}"{{/infoUrl}}]} ]}. diff --git a/modules/openapi-generator/src/main/resources/erlang-proper/app.src.mustache b/modules/openapi-generator/src/main/resources/erlang-proper/app.src.mustache index 0c9bc9c2ae0a..54b3656ffd9e 100644 --- a/modules/openapi-generator/src/main/resources/erlang-proper/app.src.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-proper/app.src.mustache @@ -1,6 +1,6 @@ { application, {{packageName}} -, [ {description, {{#appDescription}}"{{appDescription}}"{{/appDescription}}{{^appDescription}}"OpenAPI client library for EQC testing"{{/appDescription}}} - , {vsn, "{{#apiVersion}}{{apiVersion}}{{/apiVersion}}{{^apiVersion}}0.1.0{{/apiVersion}}"} +, [ {description, {{#appDescription}}"{{.}}"{{/appDescription}}{{^appDescription}}"OpenAPI client library for EQC testing"{{/appDescription}}} + , {vsn, "{{apiVersion}}{{^apiVersion}}0.1.0{{/apiVersion}}"} , {registered, []} , { applications , [ kernel @@ -10,12 +10,12 @@ ] } , { env - , [ {host, "http://{{#host}}{{{host}}}{{/host}}{{^host}}localhost:8080{{/host}}"} + , [ {host, "http://{{{host}}}{{^host}}localhost:8080{{/host}}"} , {basic_auth, {"admin", "admin"}} ] } , {modules, []} , {maintainers, []} - , {licenses, [{{#licenseInfo}}"{{licenseInfo}}"{{/licenseInfo}}]} - , {links, [{{#infoUrl}}"{{infoUrl}}"{{/infoUrl}}]} + , {licenses, [{{#licenseInfo}}"{{.}}"{{/licenseInfo}}]} + , {links, [{{#infoUrl}}"{{.}}"{{/infoUrl}}]} ]}. diff --git a/modules/openapi-generator/src/main/resources/erlang-proper/model.mustache b/modules/openapi-generator/src/main/resources/erlang-proper/model.mustache index 6aecad001cf0..e82269834dd5 100644 --- a/modules/openapi-generator/src/main/resources/erlang-proper/model.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-proper/model.mustache @@ -23,7 +23,7 @@ {{/isEnum}} {{#isArray}} {{classname}}() -> - list({{arrayModelType}}{{#minItems}}, {{minItems}}{{#maxItems}}, {{maxItems}}{{/maxItems}}{{/minItems}}). + list({{arrayModelType}}{{#minItems}}, {{minItems}}{{#maxItems}}, {{.}}{{/maxItems}}{{/minItems}}). {{/isArray}} {{^isEnum}}{{^isArray}} {{classname}}() -> @@ -31,7 +31,7 @@ {{classname}}(Fields) -> Default = [ {{#vars}}{{^-first}} - , {{/-first}}{'{{baseName}}', {{#isString}}{{#isEnum}}elements([{{#allowableValues.values}}{{^-first}}, {{/-first}}<<"{{.}}">>{{/allowableValues.values}}]){{/isEnum}}{{^isEnum}}binary({{#minLength}}{{minLength}}{{#maxLength}}, {{maxLength}}{{/maxLength}}{{/minLength}}){{/isEnum}}{{/isString}}{{^isString}}{{baseType}}{{/isString}} }{{/vars}} + , {{/-first}}{'{{baseName}}', {{#isString}}{{#isEnum}}elements([{{#allowableValues.values}}{{^-first}}, {{/-first}}<<"{{.}}">>{{/allowableValues.values}}]){{/isEnum}}{{^isEnum}}binary({{#minLength}}{{minLength}}{{#maxLength}}, {{.}}{{/maxLength}}{{/minLength}}){{/isEnum}}{{/isString}}{{^isString}}{{baseType}}{{/isString}} }{{/vars}} ], lists:ukeymerge(1, lists:sort(Fields), lists:sort(Default)). {{/isArray}}{{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/erlang-server/README.mustache b/modules/openapi-generator/src/main/resources/erlang-server/README.mustache index 9593d7162a85..5d36ca07576b 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/README.mustache @@ -55,4 +55,3 @@ Use erlang-server with erlang.mk $erl -pa ./deps/cowboy/ebin -pa ./deps/cowlib/ebin -pa ./deps/ranch/ebin -pa ./deps/jsx/ebin -pa ./deps/jesse/ebin -pa ./deps/rfc3339/ebin -pa ./ebin 4, Start project application:ensure_all_started(http_server). - diff --git a/modules/openapi-generator/src/main/resources/erlang-server/api.mustache b/modules/openapi-generator/src/main/resources/erlang-server/api.mustache index 7a6a7c26a90b..b97e4a2c5eca 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/api.mustache @@ -297,7 +297,7 @@ validation_error(ViolatedRule, Name, Info) -> throw({wrong_param, Name, ViolatedRule, Info}). -spec get_value(body | qs_val | header | binding, Name :: any(), Req0 :: cowboy_req:req()) -> - {Value :: any(), Req :: cowboy_req:req()} | + {Value :: any(), Req :: cowboy_req:req()} | {error, Reason :: any(), Req :: cowboy_req:req()}. get_value(body, _Name, Req0) -> {ok, Body, Req} = cowboy_req:read_body(Req0), @@ -327,7 +327,7 @@ prepare_body(Body) -> <<"">> -> <<"">>; _ -> try - jsx:decode(Body, [return_maps]) + jsx:decode(Body, [return_maps]) catch error:_ -> {error, {invalid_body, not_json, Body}} diff --git a/modules/openapi-generator/src/main/resources/erlang-server/app.src.mustache b/modules/openapi-generator/src/main/resources/erlang-server/app.src.mustache index 5fdef5bf7902..a90c4e7cae77 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/app.src.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/app.src.mustache @@ -1,5 +1,5 @@ {application, {{packageName}}, [ - {description, {{#appDescription}}"{{appDescription}}"{{/appDescription}}{{^appDescription}}"OpenAPI rest server library"{{/appDescription}}}, + {description, {{#appDescription}}"{{.}}"{{/appDescription}}{{^appDescription}}"OpenAPI rest server library"{{/appDescription}}}, {vsn, "{{apiVersion}}"}, {registered, []}, {applications, [ @@ -14,6 +14,6 @@ {env, [ ]}, {modules, []}, - {licenses, [{{#licenseInfo}}"{{licenseInfo}}"{{/licenseInfo}}]}, - {links, [{{#infoUrl}}"{{infoUrl}}"{{/infoUrl}}]} + {licenses, [{{#licenseInfo}}"{{.}}"{{/licenseInfo}}]}, + {links, [{{#infoUrl}}"{{.}}"{{/infoUrl}}]} ]}. diff --git a/modules/openapi-generator/src/main/resources/erlang-server/auth.mustache b/modules/openapi-generator/src/main/resources/erlang-server/auth.mustache index 3f3e9e94553d..3159e352a9c5 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/auth.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/auth.mustache @@ -50,6 +50,3 @@ get_api_key(header, KeyParam, Req) -> get_api_key(qs_val, KeyParam, Req) -> QS = cowboy_req:parse_qs(Req), { {{packageName}}_utils:get_opt(KeyParam, QS), Req}. - - - diff --git a/modules/openapi-generator/src/main/resources/erlang-server/router.mustache b/modules/openapi-generator/src/main/resources/erlang-server/router.mustache index d0136c5a190d..e2efc2206bc1 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/router.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/router.mustache @@ -76,5 +76,3 @@ prepare_validator() -> get_openapi_path() -> {ok, AppName} = application:get_application(?MODULE), filename:join({{packageName}}_utils:priv_dir(AppName), "{{{openAPISpecName}}}.json"). - - diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache index 8c8aebc852a5..1a87cdd1a972 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache @@ -18,36 +18,36 @@ module {{classname}}Handlers = {{#operation}} //#region {{operationId}} /// - /// {{#summary}}{{summary}}{{/summary}} + /// {{summary}} /// [] let {{operationId}} ([] req:HttpRequest ) = - + {{#hasBodyParam}} use reader = StreamReader(req.Body) let mediaTypes = [{{#consumes}}"{{mediaType}}";{{/consumes}}] // currently unused - + {{#bodyParam}} - let bind (contentType:string) body = - match (contentType.ToLower()) with - | "application/json" -> - body |> JsonConvert.DeserializeObject<{{operationId}}BodyParams> + let bind (contentType:string) body = + match (contentType.ToLower()) with + | "application/json" -> + body |> JsonConvert.DeserializeObject<{{operationId}}BodyParams> | _ -> failwith (sprintf "TODO - ContentType %s not currently supported" contentType) {{/bodyParam}} - let bodyParams = reader.ReadToEnd() |> bind req.ContentType + let bodyParams = reader.ReadToEnd() |> bind req.ContentType let result = {{classname}}Service.{{operationId}} bodyParams {{/hasBodyParam}} {{^hasBodyParam}} let result = {{classname}}Service.{{operationId}} () {{/hasBodyParam}} - match result with + match result with {{#responses}} | {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}} resolved -> - {{^primitiveType}} + {{^primitiveType}} let content = JsonConvert.SerializeObject resolved.content let responseContentType = "application/json" {{/primitiveType}} @@ -55,11 +55,8 @@ module {{classname}}Handlers = let content = resolved.content let responseContentType = "text/plain" {{/primitiveType}} - ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable({{code}})) + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable({{code}})) {{/responses}} {{/operation}} {{/operations}} - - - diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/HandlerParams.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/HandlerParams.mustache index 5b14e1520d18..ca4d361c02ca 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/HandlerParams.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/HandlerParams.mustache @@ -2,13 +2,13 @@ namespace {{packageName}} {{#imports}} {{#import}} -open {{import}} +open {{.}} {{/import}} {{/imports}} open System.Collections.Generic open System -module {{classname}}HandlerParams = +module {{classname}}HandlerParams = {{#operations}} {{#operation}} @@ -21,7 +21,7 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/pathParams}} {{#queryParams}} @@ -32,11 +32,11 @@ module {{classname}}HandlerParams = type {{operationId}}QueryParams = { {{/-first}} {{paramName}} : {{dataType}} {{^required}}option{{/required}}; - + {{#-last}} } //#endregion - {{/-last}} + {{/-last}} {{/queryParams}} {{#bodyParams}} @@ -44,10 +44,10 @@ module {{classname}}HandlerParams = //#region Body parameters [] {{#-last}} - type {{operationId}}BodyParams = {{dataType}} + type {{operationId}}BodyParams = {{dataType}} {{/-last}} {{^-last}} - type {{operationId}}BodyParams = { + type {{operationId}}BodyParams = { {{paramName}} : {{dataType}}; {{/-last}} {{/-first}} @@ -59,7 +59,7 @@ module {{classname}}HandlerParams = } {{/-first}} //#endregion - {{/-last}} + {{/-last}} {{/bodyParams}} {{#formParams}} @@ -71,7 +71,7 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/formParams}} {{#headerParams}} @@ -84,11 +84,11 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/headerParams}} {{#cookieParams}} - + //#region Cookie parameters {{#-first}} type {{operationId}}CookieParams = { @@ -96,14 +96,14 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/cookieParams}} {{#responses}} - + type {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}}Response = { - content:{{#dataType}}{{{.}}}{{/dataType}}{{^dataType}}string{{/dataType}}; + content:{{{dataType}}}{{^dataType}}string{{/dataType}}; {{^code}}code:int{{/code}} } {{/responses}} @@ -144,4 +144,3 @@ module {{classname}}HandlerParams = {{/allParams}} {{/operation}} {{/operations}} - \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Model.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Model.mustache index 8084cc0cf8f8..97ed754375d9 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Model.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Model.mustache @@ -7,13 +7,13 @@ open Newtonsoft.Json open {{import}} {{/imports}} -module {{classname}} = +module {{classname}} = {{#models}} {{#model}} //#region {{classname}} - {{^allowableValues}} + {{^allowableValues}} [] type {{classname}} = { {{#vars}} @@ -21,15 +21,14 @@ module {{classname}} = {{name}} : {{#isDateTime}}{{^required}}Nullable<{{/required}}{{/isDateTime}}{{{dataType}}}{{#isDateTime}}{{^required}}>{{/required}}{{/isDateTime}}; {{/vars}} } - {{/allowableValues}} + {{/allowableValues}} {{#allowableValues}} {{#enumVars}} let {{name}} = {{#isString}}"{{value}}"{{/isString}}{{#isInteger}}"{{value}}"{{/isInteger}} {{/enumVars}} type {{classname}} = {{#isString}}string{{/isString}}{{#isInteger}}int{{/isInteger}} {{/allowableValues}} - + //#endregion {{/model}} {{/models}} - \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Project.fsproj.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Project.fsproj.mustache index c0b479a470f2..b48652f82a7f 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Project.fsproj.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Project.fsproj.mustache @@ -10,7 +10,7 @@ - + PreserveNewest diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/README.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/README.mustache index 9441f3981f6f..630bfdb543c0 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/README.mustache @@ -64,9 +64,9 @@ Each Service/operation function must accept the [OperationId]Params object and r `type AddPetArgs = { bodyParams:AddPetBodyParams } type IPetApiService = abstract member AddPet:HttpContext -> AddPetArgs->AddPetResult` -[OperationId]Result is a discriminated union of all possible OpenAPI response types for that operation. +[OperationId]Result is a discriminated union of all possible OpenAPI response types for that operation. -This means that service implementations can only return status codes that have been declared in the OpenAPI specification. +This means that service implementations can only return status codes that have been declared in the OpenAPI specification. However, if the OpenAPI spec declares a default Response for an operation, the service can manually set the status code. For example: @@ -93,7 +93,7 @@ Additional handlers can be configured in the Customization.fs `let handlers : HttpHandler list = [ // insert your handlers here - GET >=> + GET >=> choose [ route "/login" >=> redirectToLogin route "/logout" >=> logout @@ -110,7 +110,7 @@ Additional handlers can be configured in the Customization.fs ## .openapi-generator-ignore -It is recommended to add src/impl/** and the project's .fsproj file to the .openapi-generator-ignore file. +It is recommended to add src/impl/** and the project's .fsproj file to the .openapi-generator-ignore file. This will allow you to regenerate model, operation and parameter files without overriding your implementations of business logic, authentication, data layers, and so on. diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceImpl.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceImpl.mustache index 543a1030190f..a4c82647d3b7 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceImpl.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceImpl.mustache @@ -1,7 +1,7 @@ namespace {{packageName}} {{#imports}} {{#import}} -open {{import}} +open {{.}} {{/import}} {{/imports}} open {{classname}}HandlerParams @@ -10,23 +10,23 @@ open System.Collections.Generic open System module {{classname}}ServiceImplementation = - + //#region Service implementation - type {{classname}}ServiceImpl() = + type {{classname}}ServiceImpl() = interface I{{classname}}Service with - + {{#operations}} {{#operation}} member this.{{operationId}} {{^hasBodyParam}}(){{/hasBodyParam}}{{#hasBodyParam}}(parameters:{{operationId}}BodyParams){{/hasBodyParam}} = {{#responses}} {{#-first}} {{^-last}} - if true then + if true then {{/-last}} {{/-first}} {{^-first}} {{^-last}} - else if true then + else if true then {{/-last}} {{#-last}} else diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceInterface.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceInterface.mustache index c57b01778fd9..8b4f02e6aff1 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceInterface.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceInterface.mustache @@ -5,9 +5,9 @@ open Microsoft.AspNetCore.Http module {{classname}}ServiceInterface = - + //#region Service interface - type I{{classname}}Service = + type I{{classname}}Service = {{#operations}} {{#operation}} abstract member {{operationId}} : {{^hasBodyParam}}unit{{/hasBodyParam}}{{#hasBodyParam}}{{operationId}}BodyParams{{/hasBodyParam}} -> {{operationId}}Result diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.bat.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.bat.mustache index 9e7afd0a272f..b3ec3de1aead 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.bat.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.bat.mustache @@ -1,3 +1,2 @@ dotnet restore {{packageName}}.fsproj dotnet build {{packageName}}.fsproj - diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.sh.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.sh.mustache index ab63b07a1420..c1cabe1d3845 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.sh.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.sh.mustache @@ -1,4 +1,3 @@ #!/bin/sh dotnet restore {{packageName}}.fsproj dotnet build {{packageName}}.fsproj - diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/AuthSchemes.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/AuthSchemes.mustache index cabb34132a61..8afe7e7ea3a8 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/AuthSchemes.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/AuthSchemes.mustache @@ -17,14 +17,14 @@ module AuthSchemes = let accessDenied : HttpHandler = setStatusCode 401 >=> text "Access Denied" - let buildGoogle (builder:AuthenticationBuilder) name authorizationUrl scopes (settings:IConfiguration) = + let buildGoogle (builder:AuthenticationBuilder) name authorizationUrl scopes (settings:IConfiguration) = builder.AddGoogle(fun googleOptions -> CustomHandlers.setOAuthOptions "Google" googleOptions scopes settings) - let buildGitHub (builder:AuthenticationBuilder) name authorizationUrl scopes (settings:IConfiguration) = + let buildGitHub (builder:AuthenticationBuilder) name authorizationUrl scopes (settings:IConfiguration) = builder.AddGitHub(fun githubOptions -> CustomHandlers.setOAuthOptions "GitHub" githubOptions scopes settings) - let buildOAuth (builder:AuthenticationBuilder) (name:string) authorizationUrl scopes (settings:IConfiguration) = - builder.AddOAuth(name, (fun (options:OAuthOptions) -> + let buildOAuth (builder:AuthenticationBuilder) (name:string) authorizationUrl scopes (settings:IConfiguration) = + builder.AddOAuth(name, (fun (options:OAuthOptions) -> options.AuthorizationEndpoint <- authorizationUrl options.TokenEndpoint <- settings.[name + "TokenUrl"] options.CallbackPath <- PathString(settings.[name + "CallbackPath"]) @@ -39,7 +39,7 @@ module AuthSchemes = else if (isNull settings.[name + "ClientSecret"]) then raise (Exception((name + "ClientSecret is not set."))) - let getOAuthBuilder settings name = + let getOAuthBuilder settings name = // check that "xxxClientId" and "xxxClientSecret" configuration variables have been set for all OAuth providers checkEnvironment settings name if OAuthBuilders.ContainsKey(name) then @@ -55,7 +55,7 @@ module AuthSchemes = {{/authMethods}} let buildApiKeyAuth name (services:AuthenticationBuilder) = - services.AddApiKey(fun options -> + services.AddApiKey(fun options -> options.Header <- name options.HeaderKey <- String.Empty let events = ApiKeyEvents() @@ -78,16 +78,16 @@ module AuthSchemes = let configureCookie (builder:AuthenticationBuilder) = builder.AddCookie(CustomHandlers.cookieAuth) - let configureServices (services:IServiceCollection) = + let configureServices (services:IServiceCollection) = let serviceProvider = services.BuildServiceProvider() let settings = serviceProvider.GetService() services.AddAuthentication(fun o -> o.DefaultScheme <- CookieAuthenticationDefaults.AuthenticationScheme) - |> configureOAuth settings + |> configureOAuth settings |> configureApiKeyAuth settings |> configureCookie - - let (|||) v1 v2 = - match v1 with + + let (|||) v1 v2 = + match v1 with | Some v -> v1 | None -> v2 @@ -96,5 +96,3 @@ module AuthSchemes = match ctx.Request.Cookies.TryGetValue key with | true , cookie -> Some cookie | false, _ -> None - - \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/CustomHandlers.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/CustomHandlers.mustache index cc176cdb66ed..d8fc28a36122 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/CustomHandlers.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/CustomHandlers.mustache @@ -21,7 +21,7 @@ open Microsoft.AspNetCore.Authentication.OAuth open System.Threading.Tasks open AspNet.Security.ApiKey.Providers.Events -module CustomHandlers = +module CustomHandlers = let cookieAuth (o : CookieAuthenticationOptions) = do @@ -30,22 +30,22 @@ module CustomHandlers = o.SlidingExpiration <- true o.ExpireTimeSpan <- TimeSpan.FromDays 7.0 - - let onCreatingTicket name (ctx:OAuthCreatingTicketContext) = + + let onCreatingTicket name (ctx:OAuthCreatingTicketContext) = task { // implement post-authentication logic for oAuth handlers here () } :> Task - let validateApiKey key = + let validateApiKey key = raise (NotImplementedException("API key validation must be implemented")) - let setApiKeyEvents name (events:ApiKeyEvents) = - events.OnApiKeyValidated <- (fun ctx -> + let setApiKeyEvents name (events:ApiKeyEvents) = + events.OnApiKeyValidated <- (fun ctx -> task { // implement your validation/authentication logic for api key handlers here - if validateApiKey ctx.ApiKey then - // to interact properly with Giraffe's handlers, you will need to manually set the identity + if validateApiKey ctx.ApiKey then + // to interact properly with Giraffe's handlers, you will need to manually set the identity // let claims = ... // let identity = ClaimsIdentity(claims, ApiKeyDefaults.AuthenticationScheme) // ctx.HttpContext.User <- ClaimsPrincipal([|identity|]) @@ -54,7 +54,7 @@ module CustomHandlers = ) events - let setOAuthOptions name (options:OAuthOptions) scopes (settings:IConfiguration) = + let setOAuthOptions name (options:OAuthOptions) scopes (settings:IConfiguration) = options.ClientId <- settings.[name + "ClientId"] options.ClientSecret <- settings.[name + "ClientSecret"] for scope in scopes do @@ -63,12 +63,12 @@ module CustomHandlers = options.Events.OnCreatingTicket <- Func(onCreatingTicket name) match name with | "Google" -> - () + () | "GitHub" -> () - | _ -> + | _ -> () - + let logout = signOut CookieAuthenticationDefaults.AuthenticationScheme >=> redirectTo false "/" let loginView = @@ -83,13 +83,13 @@ module CustomHandlers = {{/authMethods}} ] ] - - let redirectToLogin : HttpHandler = - htmlView loginView - + + let redirectToLogin : HttpHandler = + htmlView loginView + let handlers : HttpHandler list = [ // insert your handlers here - GET >=> + GET >=> choose [ route "/login" >=> redirectToLogin {{#authMethods}} @@ -108,5 +108,5 @@ module CustomHandlers = let configureApp (app : IApplicationBuilder) = app - let configureServices (services:IServiceCollection) (authBuilder:AuthenticationBuilder) = + let configureServices (services:IServiceCollection) (authBuilder:AuthenticationBuilder) = () diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Handler.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Handler.mustache index 02d959293c58..1a3a87d3d9d7 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Handler.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Handler.mustache @@ -9,11 +9,11 @@ open {{classname}}ServiceInterface open {{classname}}ServiceImplementation {{#imports}} {{#import}} -open {{import}} +open {{.}} {{/import}} {{/imports}} -module {{classname}}Handler = +module {{classname}}Handler = {{#operations}} /// @@ -23,17 +23,17 @@ module {{classname}}Handler = {{#operation}} //#region {{operationId}} /// - /// {{#summary}}{{summary}}{{/summary}} + /// {{summary}} /// - let {{operationId}} {{#hasPathParams}}(pathParams:{{operationId}}PathParams){{/hasPathParams}} : HttpHandler = + let {{operationId}} {{#hasPathParams}}(pathParams:{{operationId}}PathParams){{/hasPathParams}} : HttpHandler = fun (next : HttpFunc) (ctx : HttpContext) -> task { {{#hasQueryParams}} let queryParams = ctx.TryBindQueryString<{{operationId}}QueryParams>() {{/hasQueryParams}} {{#hasBodyParam}} - let! bodyParams = + let! bodyParams = ctx.BindJsonAsync<{{operationId}}BodyParams>() {{/hasBodyParam}} {{#hasFormParams}} @@ -52,7 +52,7 @@ module {{classname}}Handler = {{/-first}} {{/allParams}} let result = {{classname}}Service.{{operationId}} ctx {{#allParams}}{{#-first}}serviceArgs{{/-first}}{{/allParams}} - return! (match result with + return! (match result with {{#responses}} | {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}} resolved -> setStatusCode {{code}} >=> {{#primitiveType}}{{^isMap}}text{{/isMap}}{{/primitiveType}}{{^primitiveType}}json{{/primitiveType}} resolved.content @@ -63,5 +63,3 @@ module {{classname}}Handler = {{/operation}} {{/operations}} - - diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/HandlerParams.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/HandlerParams.mustache index 5b14e1520d18..ca4d361c02ca 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/HandlerParams.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/HandlerParams.mustache @@ -2,13 +2,13 @@ namespace {{packageName}} {{#imports}} {{#import}} -open {{import}} +open {{.}} {{/import}} {{/imports}} open System.Collections.Generic open System -module {{classname}}HandlerParams = +module {{classname}}HandlerParams = {{#operations}} {{#operation}} @@ -21,7 +21,7 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/pathParams}} {{#queryParams}} @@ -32,11 +32,11 @@ module {{classname}}HandlerParams = type {{operationId}}QueryParams = { {{/-first}} {{paramName}} : {{dataType}} {{^required}}option{{/required}}; - + {{#-last}} } //#endregion - {{/-last}} + {{/-last}} {{/queryParams}} {{#bodyParams}} @@ -44,10 +44,10 @@ module {{classname}}HandlerParams = //#region Body parameters [] {{#-last}} - type {{operationId}}BodyParams = {{dataType}} + type {{operationId}}BodyParams = {{dataType}} {{/-last}} {{^-last}} - type {{operationId}}BodyParams = { + type {{operationId}}BodyParams = { {{paramName}} : {{dataType}}; {{/-last}} {{/-first}} @@ -59,7 +59,7 @@ module {{classname}}HandlerParams = } {{/-first}} //#endregion - {{/-last}} + {{/-last}} {{/bodyParams}} {{#formParams}} @@ -71,7 +71,7 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/formParams}} {{#headerParams}} @@ -84,11 +84,11 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/headerParams}} {{#cookieParams}} - + //#region Cookie parameters {{#-first}} type {{operationId}}CookieParams = { @@ -96,14 +96,14 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/cookieParams}} {{#responses}} - + type {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}}Response = { - content:{{#dataType}}{{{.}}}{{/dataType}}{{^dataType}}string{{/dataType}}; + content:{{{dataType}}}{{^dataType}}string{{/dataType}}; {{^code}}code:int{{/code}} } {{/responses}} @@ -144,4 +144,3 @@ module {{classname}}HandlerParams = {{/allParams}} {{/operation}} {{/operations}} - \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Helpers.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Helpers.mustache index 6dcbe4ad94c0..5297ff251806 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Helpers.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Helpers.mustache @@ -1,12 +1,12 @@ namespace OpenAPI - module Helpers = + module Helpers = let (>=>) switch1 switch2 = - match switch1 with - | Ok v1 -> - match switch2 with + match switch1 with + | Ok v1 -> + match switch2 with | Ok v2 -> Ok(v1, v2) - | Error e -> Error e + | Error e -> Error e | Error e -> Error e \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Model.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Model.mustache index de115478e262..afb74b9a1ac5 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Model.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Model.mustache @@ -6,7 +6,7 @@ open System.Collections.Generic open {{import}} {{/imports}} -module {{classname}} = +module {{classname}} = {{#models}} {{#model}} @@ -33,4 +33,3 @@ module {{classname}} = //#endregion {{/model}} {{/models}} - \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Program.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Program.mustache index 74f0f7b2af96..7029285307ac 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Program.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Program.mustache @@ -45,7 +45,7 @@ module App = let HttpPut = PUT let HttpDelete = DELETE - let authFailure : HttpHandler = + let authFailure : HttpHandler = setStatusCode 401 >=> text "You must be authenticated to access this resource." let webApp = @@ -58,7 +58,7 @@ module App = {{/operation}} {{/operations}} {{/apis}} - RequestErrors.notFound (text "Not Found") + RequestErrors.notFound (text "Not Found") {{/apiInfo}} ]) // --------------------------------- @@ -72,13 +72,13 @@ module App = .UseResponseCaching() |> ignore CustomHandlers.configureApp app |> ignore app.UseGiraffe webApp |> ignore - + let configureServices (services : IServiceCollection) = services .AddResponseCaching() .AddGiraffe() - |> AuthSchemes.configureServices + |> AuthSchemes.configureServices |> CustomHandlers.configureServices services |> ignore services.AddDataProtection() |> ignore diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/README.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/README.mustache index 21d41400b228..8f02693beb98 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/README.mustache @@ -64,9 +64,9 @@ Each Service/operation function must accept the [OperationId]Params object and r `type AddPetArgs = { bodyParams:AddPetBodyParams } type IPetApiService = abstract member AddPet:HttpContext -> AddPetArgs->AddPetResult` -[OperationId]Result is a discriminated union of all possible OpenAPI response types for that operation. +[OperationId]Result is a discriminated union of all possible OpenAPI response types for that operation. -This means that service implementations can only return status codes that have been declared in the OpenAPI specification. +This means that service implementations can only return status codes that have been declared in the OpenAPI specification. However, if the OpenAPI spec declares a default Response for an operation, the service can manually set the status code. For example: @@ -75,7 +75,7 @@ For example: type FindPetsByStatusStatusCode400Response = { content:string; } type FindPetsByStatusResult = FindPetsByStatusDefaultStatusCode of FindPetsByStatusDefaultStatusCodeResponse | FindPetsByStatusStatusCode400 of FindPetsByStatusStatusCode400Response` -## Note on nullable/optional properties +## Note on nullable/optional properties Currently, handler parameters and models do not distinguish between required properties and optional (or nullable) properties***. @@ -121,7 +121,7 @@ Additional handlers can be configured in the Customization.fs `let handlers : HttpHandler list = [ // insert your handlers here - GET >=> + GET >=> choose [ route "/login" >=> redirectToLogin route "/logout" >=> logout @@ -165,7 +165,7 @@ You must implement your own validation logic for the key in CustomHandlers.setAp ## .openapi-generator-ignore -It is recommended to add src/impl/** and the project's .fsproj file to the .openapi-generator-ignore file. +It is recommended to add src/impl/** and the project's .fsproj file to the .openapi-generator-ignore file. This will allow you to regenerate model, operation and parameter files without overriding your implementations of business logic, authentication, data layers, and so on. diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceImpl.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceImpl.mustache index 0ab72e64e776..a43ba4f2f8d4 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceImpl.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceImpl.mustache @@ -1,7 +1,7 @@ namespace {{packageName}} {{#imports}} {{#import}} -open {{import}} +open {{.}} {{/import}} {{/imports}} open {{classname}}HandlerParams @@ -11,23 +11,23 @@ open System open Giraffe module {{classname}}ServiceImplementation = - + //#region Service implementation - type {{classname}}ServiceImpl() = + type {{classname}}ServiceImpl() = interface I{{classname}}Service with - + {{#operations}} {{#operation}} member this.{{operationId}} ctx {{#allParams}}{{#-first}}args{{/-first}}{{/allParams}} = {{#responses}} {{#-first}} {{^-last}} - if true then + if true then {{/-last}} {{/-first}} {{^-first}} {{^-last}} - else if true then + else if true then {{/-last}} {{#-last}} else diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceInterface.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceInterface.mustache index 68b14c67c264..41d887e2131a 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceInterface.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceInterface.mustache @@ -6,9 +6,9 @@ open Microsoft.AspNetCore.Http module {{classname}}ServiceInterface = - + //#region Service interface - type I{{classname}}Service = + type I{{classname}}Service = {{#operations}} {{#operation}} abstract member {{operationId}}:HttpContext {{#allParams}}{{#-first}}-> {{operationId}}Args{{/-first}}{{/allParams}}->{{operationId}}Result diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/TestHelper.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/TestHelper.mustache index c8437d7002ee..e72e3664fdf6 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/TestHelper.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/TestHelper.mustache @@ -12,7 +12,7 @@ open FSharp.Control.Tasks.V2.ContextInsensitive open Xunit open System.Text -module TestHelper = +module TestHelper = // --------------------------------- // Test server/client setup // --------------------------------- @@ -70,14 +70,14 @@ module TestHelper = let readText (response : HttpResponseMessage) = response.Content.ReadAsStringAsync() - |> Async.AwaitTask + |> Async.AwaitTask |> Async.RunSynchronously let shouldEqual expected actual = Assert.Equal(expected, actual) - let getConverter mediaType = - (fun (x:string) -> + let getConverter mediaType = + (fun (x:string) -> match mediaType with | "application/x-www-form-urlencoded" -> raise (NotSupportedException()) // TODO - implement FormUrlEncodedContent | _ -> x |> Encoding.UTF8.GetBytes |> MemoryStream |> StreamContent) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.bat.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.bat.mustache index 5c6ac5b1d175..fbe14427eb14 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.bat.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.bat.mustache @@ -1,3 +1,2 @@ dotnet restore src/{{packageName}}.fsproj dotnet build src/{{packageName}}.fsproj - diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.sh.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.sh.mustache index 2a97c479bc9e..ebf8f4ca9b08 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.sh.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.sh.mustache @@ -1,4 +1,3 @@ #!/bin/sh dotnet restore src/{{packageName}}.fsproj dotnet build src/{{packageName}}.fsproj - diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/README.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/README.mustache index 2e52e2061759..94cc83ad70c2 100644 --- a/modules/openapi-generator/src/main/resources/go-deprecated/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/README.mustache @@ -1,7 +1,7 @@ # Go API client for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview @@ -43,7 +43,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/api.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/api.mustache index f85854a4fc9f..b837934add78 100644 --- a/modules/openapi-generator/src/main/resources/go-deprecated/api.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/api.mustache @@ -25,7 +25,7 @@ type {{classname}} interface { * {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -43,10 +43,10 @@ type {{classname}} interface { {{/allParams}} {{/hasOptionalParams}} {{#returnType}} - * @return {{{returnType}}} + * @return {{{.}}} {{/returnType}} */ - {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) + {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) {{/operation}} } @@ -80,7 +80,7 @@ type {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts struct { * {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -98,10 +98,10 @@ type {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts struct { {{/allParams}} {{/hasOptionalParams}} {{#returnType}} - * @return {{{returnType}}} + * @return {{{.}}} {{/returnType}} */ -func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) { +func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.Method{{httpMethod}} localVarPostBody interface{} @@ -109,13 +109,13 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams localVarFileName string localVarFileBytes []byte {{#returnType}} - localVarReturnValue {{{returnType}}} + localVarReturnValue {{{.}}} {{/returnType}} ) // create path and map variables localVarPath := a.client.cfg.BasePath + "{{{path}}}"{{#pathParams}} - localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", _neturl.PathEscape(parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", _neturl.PathEscape(parameterToString({{paramName}}, "{{collectionFormat}}")) , -1) {{/pathParams}} localVarHeaderParams := make(map[string]string) @@ -177,15 +177,15 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{collectionFormat}}")) } } else { - localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{collectionFormat}}")) } } {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - localVarQueryParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{collectionFormat}}")) {{/isCollectionFormatMulti}} {{/required}} {{^required}} @@ -195,14 +195,14 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{collectionFormat}}")) } } else { - localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{collectionFormat}}")) } {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - localVarQueryParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{collectionFormat}}")) {{/isCollectionFormatMulti}} } {{/required}} @@ -232,11 +232,11 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams {{#hasHeaderParams}} {{#headerParams}} {{#required}} - localVarHeaderParams["{{baseName}}"] = parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}") + localVarHeaderParams["{{baseName}}"] = parameterToString({{paramName}}, "{{collectionFormat}}") {{/required}} {{^required}} if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { - localVarHeaderParams["{{baseName}}"] = parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}") + localVarHeaderParams["{{baseName}}"] = parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{collectionFormat}}") } {{/required}} {{/headerParams}} @@ -267,7 +267,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams {{/isFile}} {{^isFile}} {{#required}} - localVarFormParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarFormParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{collectionFormat}}")) {{/required}} {{^required}} {{#isModel}} @@ -281,7 +281,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams {{/isModel}} {{^isModel}} if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { - localVarFormParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarFormParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{collectionFormat}}")) } {{/isModel}} {{/required}} diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/api_doc.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/api_doc.mustache index aaa9f553adbb..468ee78bbf54 100644 --- a/modules/openapi-generator/src/main/resources/go-deprecated/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/api_doc.mustache @@ -1,12 +1,12 @@ # {{invokerPackage}}\{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{{operationId}}} -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}(ctx, {{#allParams}}{{#required}}{{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}optional{{/hasOptionalParams}}) +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}(ctx, {{#allParams}}{{#required}}{{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}optional{{/hasOptionalParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Required Parameters @@ -26,7 +26,7 @@ Method | HTTP request | Description Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.{{/-last}}{{/allParams}}{{#allParams}}{{#required}} -**{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/required}}{{/allParams}}{{#hasOptionalParams}} +**{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{.}}]{{/defaultValue}}{{/required}}{{/allParams}}{{#hasOptionalParams}} **optional** | ***{{{nickname}}}Opts** | optional parameters | nil if no parameters ### Optional Parameters @@ -36,7 +36,7 @@ Optional parameters are passed through a pointer to a {{{nickname}}}Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}{{#allParams}} -{{^required}} **{{paramName}}** | {{#isFile}}**optional.Interface of {{dataType}}**{{/isFile}}{{#isPrimitiveType}}**optional.{{vendorExtensions.x-optional-data-type}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**optional.Interface of {{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/required}}{{/allParams}}{{/hasOptionalParams}} +{{^required}} **{{paramName}}** | {{#isFile}}**optional.Interface of {{dataType}}**{{/isFile}}{{#isPrimitiveType}}**optional.{{vendorExtensions.x-optional-data-type}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**optional.Interface of {{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{.}}]{{/defaultValue}}{{/required}}{{/allParams}}{{/hasOptionalParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/configuration.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/configuration.mustache index b21d2a13a230..46322cf507ae 100644 --- a/modules/openapi-generator/src/main/resources/go-deprecated/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/configuration.mustache @@ -88,7 +88,7 @@ func NewConfiguration() *Configuration { cfg := &Configuration{ BasePath: "{{{basePath}}}", DefaultHeader: make(map[string]string), - UserAgent: "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/go{{/httpUserAgent}}", + UserAgent: "{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/go{{/httpUserAgent}}", Debug: false, {{#servers}} {{#-first}} diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100755 --- a/modules/openapi-generator/src/main/resources/go-deprecated/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/model.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/model.mustache index f30047a9e216..cf2d15413d6c 100644 --- a/modules/openapi-generator/src/main/resources/go-deprecated/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/model.mustache @@ -12,8 +12,8 @@ import ( {{/imports}} {{#model}} {{#isEnum}} -// {{{classname}}} {{#description}}{{{.}}}{{/description}}{{^description}}the model '{{{classname}}}'{{/description}} -type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} +// {{{classname}}} {{{description}}}{{^description}}the model '{{{classname}}}'{{/description}} +type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{{format}}} // List of {{{name}}} const ( @@ -27,13 +27,13 @@ const ( ) {{/isEnum}} {{^isEnum}} -// {{classname}}{{#description}} {{{description}}}{{/description}}{{^description}} struct for {{{classname}}}{{/description}} +// {{classname}}{{#description}} {{{.}}}{{/description}}{{^description}} struct for {{{classname}}}{{/description}} type {{classname}} struct { {{#allVars}} {{^-first}} {{/-first}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} {{name}} {{#isNullable}}*{{/isNullable}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` {{/allVars}} diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/partial_header.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/partial_header.mustache index e23b21520a9f..f0a0906d6d23 100644 --- a/modules/openapi-generator/src/main/resources/go-deprecated/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/partial_header.mustache @@ -1,17 +1,17 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} {{#version}} - * API version: {{{version}}} + * API version: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} {{^withGoCodegenComment}} * Generated by: OpenAPI Generator (https://openapi-generator.tech) diff --git a/modules/openapi-generator/src/main/resources/go-echo-server/README.mustache b/modules/openapi-generator/src/main/resources/go-echo-server/README.mustache index 9ff2b9aeb19f..f45fd404673a 100644 --- a/modules/openapi-generator/src/main/resources/go-echo-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-echo-server/README.mustache @@ -1,13 +1,13 @@ # Go Echo API Server for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview This server was generated by the [openapi-generator] (https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. - To see how to make this your own, look here: @@ -36,7 +36,7 @@ docker build --network=host -t {{{packageName}}} . Once the image is built, just run ``` -docker run --rm -it {{{packageName}}} +docker run --rm -it {{{packageName}}} ``` ### Known Issue diff --git a/modules/openapi-generator/src/main/resources/go-echo-server/main.mustache b/modules/openapi-generator/src/main/resources/go-echo-server/main.mustache index e8654aaa3f27..97736d7f083e 100644 --- a/modules/openapi-generator/src/main/resources/go-echo-server/main.mustache +++ b/modules/openapi-generator/src/main/resources/go-echo-server/main.mustache @@ -15,7 +15,7 @@ func main() { // Middleware e.Use(middleware.Logger()) e.Use(middleware.Recover()) - + {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} // {{nickname}} - {{{summary}}}{{#isDeprecated}} (deprecated){{/isDeprecated}} e.{{httpMethod.toUpperCase}}("{{{basePathWithoutHost}}}{{{path}}}", c.{{operationId}}) diff --git a/modules/openapi-generator/src/main/resources/go-echo-server/model.mustache b/modules/openapi-generator/src/main/resources/go-echo-server/model.mustache index 433d848254b2..ec58995c7836 100644 --- a/modules/openapi-generator/src/main/resources/go-echo-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-echo-server/model.mustache @@ -4,7 +4,7 @@ package models {{/-first}} "{{import}}"{{#-last}} ) {{/-last}}{{/imports}}{{#model}}{{#isEnum}}{{#description}}// {{{classname}}} : {{{description}}}{{/description}} -type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} +type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{{format}}} // List of {{{classname}}} const ( @@ -17,7 +17,7 @@ const ( // {{classname}} - {{{description}}}{{/description}} type {{classname}} struct { {{#vars}}{{#description}} - // {{{description}}}{{/description}} + // {{{.}}}{{/description}} {{#deprecated}} // Deprecated {{/deprecated}} diff --git a/modules/openapi-generator/src/main/resources/go-gin-server/README.mustache b/modules/openapi-generator/src/main/resources/go-gin-server/README.mustache index 3ad44c6fa7a7..972ecfa6f09a 100644 --- a/modules/openapi-generator/src/main/resources/go-gin-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-gin-server/README.mustache @@ -1,13 +1,13 @@ # Go API Server for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview This server was generated by the [openapi-generator] (https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. - To see how to make this your own, look here: @@ -35,7 +35,7 @@ docker build --network=host -t {{{packageName}}} . Once the image is built, just run ``` -docker run --rm -it {{{packageName}}} +docker run --rm -it {{{packageName}}} ``` ### Known Issue @@ -43,4 +43,3 @@ docker run --rm -it {{{packageName}}} Endpoints sharing a common path may result in issues. For example, `/v2/pet/findByTags` and `/v2/pet/:petId` will result in an issue with the Gin framework. For more information about this known limitation, please refer to [gin-gonic/gin#388](https://github.com/gin-gonic/gin/issues/388) for more information. A workaround is to manually update the path and handler. Please refer to [gin-gonic/gin/issues/205#issuecomment-296155497](https://github.com/gin-gonic/gin/issues/205#issuecomment-296155497) for more information. - diff --git a/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache b/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache index 14993caf01a1..2ffa77c2c9e6 100644 --- a/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache @@ -5,7 +5,7 @@ package {{packageName}} {{/-first}} "{{import}}"{{#-last}} ) {{/-last}}{{/imports}}{{#model}}{{#isEnum}}{{#description}}// {{{classname}}} : {{{description}}}{{/description}} -type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} +type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{{format}}} // List of {{{classname}}} const ( @@ -18,7 +18,7 @@ const ( // {{classname}} - {{{description}}}{{/description}} type {{classname}} struct { {{#vars}}{{#description}} - // {{{description}}}{{/description}} + // {{{.}}}{{/description}} {{#deprecated}} // Deprecated {{/deprecated}} diff --git a/modules/openapi-generator/src/main/resources/go-gin-server/partial_header.mustache b/modules/openapi-generator/src/main/resources/go-gin-server/partial_header.mustache index 23edcdfb6915..07920e304137 100644 --- a/modules/openapi-generator/src/main/resources/go-gin-server/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/go-gin-server/partial_header.mustache @@ -1,17 +1,17 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} {{#version}} - * API version: {{{version}}} + * API version: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/modules/openapi-generator/src/main/resources/go-server/README.mustache b/modules/openapi-generator/src/main/resources/go-server/README.mustache index 5a59be673826..cdf8713c2e6e 100644 --- a/modules/openapi-generator/src/main/resources/go-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/README.mustache @@ -1,13 +1,13 @@ # Go API Server for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview This server was generated by the [openapi-generator] (https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. - To see how to make this your own, look here: @@ -35,7 +35,5 @@ docker build --network=host -t {{{packageName}}} . Once image is built use ``` -docker run --rm -it {{{packageName}}} +docker run --rm -it {{{packageName}}} ``` - - diff --git a/modules/openapi-generator/src/main/resources/go-server/api.mustache b/modules/openapi-generator/src/main/resources/go-server/api.mustache index f08e1b270386..b0ae118950dc 100644 --- a/modules/openapi-generator/src/main/resources/go-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/api.mustache @@ -10,7 +10,7 @@ import ( {{#apiInfo}}{{#apis}} // {{classname}}Router defines the required methods for binding the api requests to a responses for the {{classname}} -// The {{classname}}Router implementation should parse necessary information from the http request, +// The {{classname}}Router implementation should parse necessary information from the http request, // pass the data to a {{classname}}Servicer to perform the required actions, then write the service results to the http response. type {{classname}}Router interface { {{#operations}}{{#operation}} {{#isDeprecated}} @@ -21,8 +21,8 @@ type {{classname}}Router interface { {{#operations}}{{#operation}} // {{classname}}Servicer defines the api actions for the {{classname}} service -// This interface intended to stay up to date with the openapi yaml used to generate it, -// while the service implementation can ignored with the .openapi-generator-ignore file +// This interface intended to stay up to date with the openapi yaml used to generate it, +// while the service implementation can ignored with the .openapi-generator-ignore file // and updated with the logic required for the API. type {{classname}}Servicer interface { {{#operations}}{{#operation}} {{#isDeprecated}} diff --git a/modules/openapi-generator/src/main/resources/go-server/model.mustache b/modules/openapi-generator/src/main/resources/go-server/model.mustache index c13d81795add..8a4dd7a97904 100644 --- a/modules/openapi-generator/src/main/resources/go-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/model.mustache @@ -5,7 +5,7 @@ package {{packageName}} {{/-first}} "{{import}}"{{#-last}} ) {{/-last}}{{/imports}}{{#model}}{{#isEnum}}{{#description}}// {{{classname}}} : {{{description}}}{{/description}} -type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} +type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{{format}}} // List of {{{classname}}} const ( @@ -28,7 +28,7 @@ type {{classname}} struct { {{/isArray}} {{/parent}} {{#vars}}{{#description}} - // {{{description}}}{{/description}} + // {{{.}}}{{/description}} {{#deprecated}} // Deprecated {{/deprecated}} diff --git a/modules/openapi-generator/src/main/resources/go-server/partial_header.mustache b/modules/openapi-generator/src/main/resources/go-server/partial_header.mustache index 23edcdfb6915..07920e304137 100644 --- a/modules/openapi-generator/src/main/resources/go-server/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/partial_header.mustache @@ -1,17 +1,17 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} {{#version}} - * API version: {{{version}}} + * API version: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/modules/openapi-generator/src/main/resources/go-server/service.mustache b/modules/openapi-generator/src/main/resources/go-server/service.mustache index 2df7298b17ba..6339027c099e 100644 --- a/modules/openapi-generator/src/main/resources/go-server/service.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/service.mustache @@ -9,7 +9,7 @@ import ( ) // {{classname}}Service is a service that implents the logic for the {{classname}}Servicer -// This service should implement the business logic for every endpoint for the {{classname}} API. +// This service should implement the business logic for every endpoint for the {{classname}} API. // Include any external packages or services that will be required by this service. type {{classname}}Service struct { } @@ -41,4 +41,3 @@ func (s *{{classname}}Service) {{nickname}}(ctx context.Context{{#allParams}}, { {{/responses}} return Response(http.StatusNotImplemented, nil), errors.New("{{nickname}} method not implemented") }{{/operation}}{{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/go/README.mustache b/modules/openapi-generator/src/main/resources/go/README.mustache index de164be1cf81..3eb9c387eb73 100644 --- a/modules/openapi-generator/src/main/resources/go/README.mustache +++ b/modules/openapi-generator/src/main/resources/go/README.mustache @@ -1,7 +1,7 @@ # Go API client for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index 8cc5dfd6009d..06a0ab7b9dc0 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -363,7 +363,7 @@ func (c *APIClient) prepareRequest( reader = strings.NewReader(body.String()) } - // Define default values for region and service to maintain backward compatibility + // Define default values for region and service to maintain backward compatibility region := auth.Region if region == "" { region = "eu-west-2" diff --git a/modules/openapi-generator/src/main/resources/go/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/go/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100755 --- a/modules/openapi-generator/src/main/resources/go/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/go/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/go/model_simple.mustache b/modules/openapi-generator/src/main/resources/go/model_simple.mustache index a2e30fc4b8fc..bda8563ed17c 100644 --- a/modules/openapi-generator/src/main/resources/go/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_simple.mustache @@ -14,7 +14,7 @@ type {{classname}} struct { {{^-first}} {{/-first}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} {{#deprecated}} // Deprecated @@ -305,7 +305,7 @@ func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) { {{^-first}} {{/-first}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} {{#deprecated}} // Deprecated diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/README.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/README.mustache index 2e556cc0666a..522ed33b2797 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/README.mustache @@ -1,7 +1,7 @@ # GraphQL express API server {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Requirements diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api.mustache index 9d59eab63ae5..736f40e11a10 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api.mustache @@ -9,7 +9,7 @@ input {{operationId}}Input { {{#allParams}} - {{#description}}# {{description}}{{/description}} + {{#description}}# {{.}}{{/description}} {{paramName}}: {{#isContainer}}[{{/isContainer}}{{dataType}}{{#isArray}}Input{{/isArray}}{{#isModel}}Input{{/isModel}}{{#isContainer}}]{{/isContainer}}{{^-last}}, {{/-last}} {{/allParams}} }{{/hasParams}}{{/vendorExtensions.x-is-mutation}}{{/operation}} @@ -18,16 +18,16 @@ type Mutation { {{#operation}} {{#vendorExtensions.x-is-mutation}} {{#summary}} - # {{summary}} + # {{.}} {{/summary}} {{#notes}} - # {{notes}} + # {{.}} {{/notes}} {{#allParams}} # @param {{dataType}} {{paramName}} {{description}} {{/allParams}} - # @return [{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Boolean{{/returnType}}] - {{operationId}}{{#hasParams}}(input: {{operationId}}Input!){{/hasParams}}: {{#returnType}}{{.}}{{/returnType}}{{^returnType}}Boolean{{/returnType}} + # @return [{{returnType}}{{^returnType}}Boolean{{/returnType}}] + {{operationId}}{{#hasParams}}(input: {{operationId}}Input!){{/hasParams}}: {{returnType}}{{^returnType}}Boolean{{/returnType}} {{/vendorExtensions.x-is-mutation}} {{/operation}} } @@ -38,16 +38,16 @@ type Query { {{#operation}} {{^vendorExtensions.x-is-mutation}} {{#summary}} - # {{summary}} + # {{.}} {{/summary}} {{#notes}} - # {{notes}} + # {{.}} {{/notes}} {{#allParams}} # @param {{dataType}} {{paramName}} {{description}} {{/allParams}} - # @return [{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Boolean{{/returnType}}] - {{operationId}}{{#hasParams}}({{#allParams}}{{paramName}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}){{/hasParams}}: {{#returnType}}{{.}}{{/returnType}}{{^returnType}}Boolean{{/returnType}} + # @return [{{returnType}}{{^returnType}}Boolean{{/returnType}}] + {{operationId}}{{#hasParams}}({{#allParams}}{{paramName}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}){{/hasParams}}: {{returnType}}{{^returnType}}Boolean{{/returnType}} {{/vendorExtensions.x-is-mutation}} {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api_doc.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api_doc.mustache index c41fd6e4f374..28aa346a94f6 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api_doc.mustache @@ -1,21 +1,21 @@ # {{classname}}{{#description}} - {{description}}{{/description}} + {{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{operationId}}** -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} {{/operation}} {{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/model.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/model.mustache index 3bbbb5199df5..25a62c0302fc 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/model.mustache @@ -2,12 +2,12 @@ {{#model}} {{>partial_header_graphql}} {{#description}} -# {{{description}}} +# {{{.}}} {{/description}} type {{classname}} { {{#vars}} {{#description}} - # {{{description}}} + # {{{.}}} {{/description}} {{baseName}}: {{#isEnum}}{{classname}}{{datatypeWithEnum}}{{/isEnum}}{{^isEnum}}{{datatypeWithEnum}}{{/isEnum}} {{/vars}} @@ -16,7 +16,7 @@ type {{classname}} { input {{classname}}Input { {{#vars}} {{#description}} - # {{{description}}} + # {{{.}}} {{/description}} {{baseName}}: {{#isEnum}}{{classname}}{{datatypeWithEnum}}{{/isEnum}}{{^isEnum}}{{#isContainer}}[{{datatypeWithEnum}}{{#complexType}}Input{{/complexType}}]{{/isContainer}}{{^isContainer}}{{datatypeWithEnum}}{{#isModel}}Input{{/isModel}}{{/isContainer}}{{/isEnum}} {{/vars}} @@ -25,7 +25,7 @@ input {{classname}}Input { {{#isEnum}} {{#description}} -# {{{description}}} +# {{{.}}} {{/description}} enum {{classname}}{{enumName}} { {{#allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/package.json.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/package.json.mustache index 71324a2093b6..871be2f6ee3f 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/package.json.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/package.json.mustache @@ -1,7 +1,7 @@ { "name": "graphql-server", "version": "1.0.0", - "description": "{{#appDescription}} {{{appDescription}}} {{/appDescription}}", + "description": "{{#appDescription}} {{{.}}} {{/appDescription}}", "main": "index.js", "scripts": { "start": "node start.js", diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header.mustache index 1e1214c8a693..66e3e0011d36 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header.mustache @@ -1,11 +1,11 @@ /** * {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} * {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} - * {{#version}}Version: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}Version: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header_graphql.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header_graphql.mustache index 8e97c5d4f0be..c647d74ab5c2 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header_graphql.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header_graphql.mustache @@ -1,9 +1,9 @@ # {{#appName}} -# {{{appName}}} +# {{{.}}} # {{/appName}} # {{#appDescription}} -# {{{appDescription}}} +# {{{.}}} # {{/appDescription}} -# {{#version}}Version: {{{version}}}{{/version}} -# {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +# {{#version}}Version: {{{.}}}{{/version}} +# {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} # Generated by OpenAPI Generator: https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache index 75f88357c43d..bca3b8ce1ffd 100644 --- a/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache @@ -1,7 +1,7 @@ # Lua API client for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview @@ -29,7 +29,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/api.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/api.mustache index 6f9532b82e8f..2b8543f655d7 100644 --- a/modules/openapi-generator/src/main/resources/graphql-schema/api.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-schema/api.mustache @@ -8,16 +8,16 @@ type mutation { {{#operation}} {{#vendorExtensions.x-is-mutation}} {{#summary}} - # {{summary}} + # {{.}} {{/summary}} {{#notes}} - # {{notes}} + # {{.}} {{/notes}} {{#allParams}} # @param {{dataType}} {{paramName}} {{description}} {{/allParams}} - # @return [{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}null{{/returnType}}] - {{operationId}}({{#allParams}}{{paramName}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}): {{#returnType}}{{.}}{{/returnType}}{{^returnType}}null{{/returnType}} + # @return [{{returnType}}{{^returnType}}null{{/returnType}}] + {{operationId}}({{#allParams}}{{paramName}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}): {{returnType}}{{^returnType}}null{{/returnType}} {{/vendorExtensions.x-is-mutation}} {{/operation}} @@ -29,16 +29,16 @@ type query { {{#operation}} {{^vendorExtensions.x-is-mutation}} {{#summary}} - # {{summary}} + # {{.}} {{/summary}} {{#notes}} - # {{notes}} + # {{.}} {{/notes}} {{#allParams}} # @param {{dataType}} {{paramName}} {{description}} {{/allParams}} - # @return [{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}null{{/returnType}}] - {{operationId}}({{#allParams}}{{paramName}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}): {{#returnType}}{{.}}{{/returnType}}{{^returnType}}null{{/returnType}} + # @return [{{returnType}}{{^returnType}}null{{/returnType}}] + {{operationId}}({{#allParams}}{{paramName}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}): {{returnType}}{{^returnType}}null{{/returnType}} {{/vendorExtensions.x-is-mutation}} {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100755 --- a/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/model.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/model.mustache index 9c06501f4325..bc2f808d8fcd 100644 --- a/modules/openapi-generator/src/main/resources/graphql-schema/model.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-schema/model.mustache @@ -2,13 +2,13 @@ {{#model}} {{>partial_header}} {{#description}} -# {{description}} +# {{.}} {{/description}} type {{classname}} { {{#vars}} {{#description}} - # {{description}} + # {{.}} {{/description}} {{baseName}}: {{datatypeWithEnum}} @@ -18,7 +18,7 @@ type {{classname}} { {{#isEnum}} {{#description}} -# {{description}} +# {{.}} {{/description}} enum {{enumName}} { {{#allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/partial_header.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/partial_header.mustache index 541eedc14442..0ea833544f1c 100644 --- a/modules/openapi-generator/src/main/resources/graphql-schema/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-schema/partial_header.mustache @@ -1,14 +1,14 @@ {{#appName}} -# {{{appName}}} +# {{{.}}} {{/appName}} {{#appDescription}} -# {{{appDescription}}} +# {{{.}}} {{/appDescription}} {{#version}} -# The version of the OpenAPI document: {{{version}}} +# The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} -# Contact: {{{infoEmail}}} +# Contact: {{{.}}} {{/infoEmail}} # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/API.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/API.mustache index 38a7699b17b2..eaedbb92a4e8 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/API.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/API.mustache @@ -60,7 +60,7 @@ import qualified Prelude as P -- {{/hasAuthMethods}}{{#vendorExtensions.x-has-unknown-return}} -- Note: Has 'Produces' instances, but no response schema -- {{/vendorExtensions.x-has-unknown-return}} -{{operationId}} +{{operationId}} :: {{#vendorExtensions.x-has-body-or-form-param}}(Consumes {{{vendorExtensions.x-operation-type}}} {{>_contentType}}{{#allParams}}{{#isBodyParam}}{{#required}}, MimeRender {{>_contentType}} {{#vendorExtensions.x-param-name-type}}{{{.}}}{{/vendorExtensions.x-param-name-type}}{{^vendorExtensions.x-param-name-type}}{{{dataType}}}{{/vendorExtensions.x-param-name-type}}{{/required}}{{/isBodyParam}}{{/allParams}}) => {{^vendorExtensions.x-inline-content-type}}ContentType contentType -- ^ request content-type ('MimeType') -> {{/vendorExtensions.x-inline-content-type}}{{/vendorExtensions.x-has-body-or-form-param}}{{^vendorExtensions.x-inline-accept}}Accept accept -- ^ request accept ('MimeType') @@ -92,7 +92,7 @@ instance HasOptionalParam {{{vendorExtensions.x-operation-type}}} {{#vendorExten instance Consumes {{{vendorExtensions.x-operation-type}}} {{{x-mediaDataType}}}{{/x-mediaIsWildcard}}{{#x-mediaIsWildcard}} instance MimeType mtype => Consumes {{{vendorExtensions.x-operation-type}}} mtype{{/x-mediaIsWildcard}} {{/consumes}}{{/hasConsumes}}{{^hasConsumes}}{{#vendorExtensions.x-has-body-or-form-param}} - + -- | @*/*@ instance MimeType mtype => Consumes {{{vendorExtensions.x-operation-type}}} mtype {{/vendorExtensions.x-has-body-or-form-param}}{{/hasConsumes}}{{#hasProduces}} diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/Client.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/Client.mustache index cd2c451a3a77..e3969468f17b 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/Client.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/Client.mustache @@ -60,7 +60,7 @@ dispatchLbs manager config request = do -- | pair of decoded http body and http response data MimeResult res = MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body - , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response + , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response } deriving (Show, Functor, Foldable, Traversable) @@ -68,7 +68,7 @@ data MimeResult res = data MimeError = MimeError { mimeError :: String -- ^ unrender/parser error - , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response + , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response } deriving (Eq, Show) -- | send a request returning the 'MimeResult' @@ -162,7 +162,7 @@ _toInitRequest => {{configType}} -- ^ config -> {{requestType}} req contentType res accept -- ^ request -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 = +_toInitRequest config req0 = runConfigLogWithExceptions "Client" config $ do parsedReq <- P.liftIO $ NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) req1 <- P.liftIO $ _applyAuthMethods req0 config @@ -193,7 +193,7 @@ modifyInitRequest (InitRequest req) f = InitRequest (f req) modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) --- ** Logging +-- ** Logging -- | Run a block using the configured logger instance runConfigLog diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/Core.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/Core.mustache index 2a20a43be0ac..dfcf3ce6e222 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/Core.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/Core.mustache @@ -61,7 +61,7 @@ import Prelude (($), (.), (<$>), (<*>), Maybe(..), Bool(..), Char, String, fmap, -- * {{configType}} --- | +-- | data {{configType}} = {{configType}} { configHost :: BCL.ByteString -- ^ host supplied in the Request , configUserAgent :: Text -- ^ user-agent supplied in the Request @@ -87,19 +87,19 @@ instance P.Show {{configType}} where -- -- configUserAgent: -- --- @"{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{cabalName}}}/{{{cabalVersion}}}{{/httpUserAgent}}"@ +-- @"{{{httpUserAgent}}}{{^httpUserAgent}}{{{cabalName}}}/{{{cabalVersion}}}{{/httpUserAgent}}"@ -- newConfig :: IO {{configType}} newConfig = do logCxt <- initLogContext return $ {{configType}} { configHost = "{{{basePath}}}" - , configUserAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{cabalName}}}/{{{cabalVersion}}}{{/httpUserAgent}}" + , configUserAgent = "{{{httpUserAgent}}}{{^httpUserAgent}}{{{cabalName}}}/{{{cabalVersion}}}{{/httpUserAgent}}" , configLogExecWithContext = runDefaultLogExecWithContext , configLogContext = logCxt , configAuthMethods = [] , configValidateAuthMethods = True - } + } -- | updates config use AuthMethod on matching requests addAuthMethod :: AuthMethod auth => {{configType}} -> auth -> {{configType}} @@ -121,7 +121,7 @@ withStderrLogging p = do -- | updates the config to disable logging withNoLogging :: {{configType}} -> {{configType}} withNoLogging p = p { configLogExecWithContext = runNullLogExec} - + -- * {{requestType}} -- | Represents a request. @@ -220,7 +220,7 @@ data ParamBody -- ** {{requestType}} Utils -_mkRequest :: NH.Method -- ^ Method +_mkRequest :: NH.Method -- ^ Method -> [BCL.ByteString] -- ^ Endpoint -> {{requestType}} req contentType res accept -- ^ req: Request Type, res: Response Type _mkRequest m u = {{requestType}} m u _mkParams [] @@ -254,13 +254,13 @@ removeHeader req header = _setContentTypeHeader :: forall req contentType res accept. MimeType contentType => {{requestType}} req contentType res accept -> {{requestType}} req contentType res accept _setContentTypeHeader req = - case mimeType (P.Proxy :: P.Proxy contentType) of + case mimeType (P.Proxy :: P.Proxy contentType) of Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)] Nothing -> req `removeHeader` ["content-type"] _setAcceptHeader :: forall req contentType res accept. MimeType accept => {{requestType}} req contentType res accept -> {{requestType}} req contentType res accept _setAcceptHeader req = - case mimeType (P.Proxy :: P.Proxy accept) of + case mimeType (P.Proxy :: P.Proxy accept) of Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] Nothing -> req `removeHeader` ["accept"] @@ -284,25 +284,25 @@ addQuery :: addQuery req query = req & L.over (rParamsL . paramsQueryL) (query P.++) addForm :: {{requestType}} req contentType res accept -> WH.Form -> {{requestType}} req contentType res accept -addForm req newform = +addForm req newform = let form = case paramsBody (rParams req) of ParamBodyFormUrlEncoded _form -> _form _ -> mempty in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) _addMultiFormPart :: {{requestType}} req contentType res accept -> NH.Part -> {{requestType}} req contentType res accept -_addMultiFormPart req newpart = +_addMultiFormPart req newpart = let parts = case paramsBody (rParams req) of ParamBodyMultipartFormData _parts -> _parts _ -> [] in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) _setBodyBS :: {{requestType}} req contentType res accept -> B.ByteString -> {{requestType}} req contentType res accept -_setBodyBS req body = +_setBodyBS req body = req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) _setBodyLBS :: {{requestType}} req contentType res accept -> BL.ByteString -> {{requestType}} req contentType res accept -_setBodyLBS req body = +_setBodyLBS req body = req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) _hasAuthType :: AuthMethod authMethod => {{requestType}} req contentType res accept -> P.Proxy authMethod -> {{requestType}} req contentType res accept @@ -371,7 +371,7 @@ _toCollA' c encode one xs = case c of {-# INLINE go #-} {-# INLINE expandList #-} {-# INLINE combine #-} - + -- * AuthMethods -- | Provides a method to apply auth methods to requests @@ -402,7 +402,7 @@ _applyAuthMethods req config@({{configType}} {configAuthMethods = as}) = foldlM go req as where go r (AnyAuthMethod a) = applyAuthMethod config a r - + -- * Utils -- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON) @@ -445,16 +445,16 @@ instance P.Show DateTime where instance MimeRender MimeMultipartFormData DateTime where mimeRender _ = mimeRenderDefaultMultipartFormData --- | @{{#dateTimeParseFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeParseFormat}}}"{{/dateTimeParseFormat}}{{^dateTimeParseFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}{{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{/dateTimeParseFormat}}@ +-- | @{{#dateTimeParseFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{.}}}"{{/dateTimeParseFormat}}{{^dateTimeParseFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{.}}}"{{/dateTimeFormat}}{{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{/dateTimeParseFormat}}@ _readDateTime :: (MonadFail m{{^dateTimeFormat}}, Alternative m{{/dateTimeFormat}}) => String -> m DateTime _readDateTime s = - DateTime <$> {{#dateTimeParseFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeParseFormat}}}"{{/dateTimeParseFormat}}{{^dateTimeParseFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}{{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{/dateTimeParseFormat}} s + DateTime <$> {{#dateTimeParseFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{.}}}"{{/dateTimeParseFormat}}{{^dateTimeParseFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{.}}}"{{/dateTimeFormat}}{{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{/dateTimeParseFormat}} s {-# INLINE _readDateTime #-} --- | @{{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}}{{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}@ +-- | @{{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}}{{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{.}}}"{{/dateTimeFormat}}@ _showDateTime :: ({{^dateTimeFormat}}t ~ TI.UTCTime, {{/dateTimeFormat}}TI.FormatTime t) => t -> String _showDateTime = - {{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}{{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}} + {{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{.}}}"{{/dateTimeFormat}}{{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}} {-# INLINE _showDateTime #-} -- | parse an ISO8601 date-time string @@ -495,7 +495,7 @@ _showDate = -- * Byte/Binary Formatting - + -- | base64 encoded characters newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/LoggingKatip.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/LoggingKatip.mustache index 693820cd2916..479818737aea 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/LoggingKatip.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/LoggingKatip.mustache @@ -106,4 +106,3 @@ levelError = LG.ErrorS levelDebug :: LogLevel levelDebug = LG.DebugS - diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/Model.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/Model.mustache index b6ffd40e3ad0..7655a54c09f5 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/Model.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/Model.mustache @@ -72,11 +72,11 @@ newtype {{{x-param-name-type}}} = {{{x-param-name-type}}} { un{{{x-param-name-ty -- {{{.}}}{{/description}}{{#isAlias}} newtype {{classname}} = {{classname}} { un{{classname}} :: {{{vendorExtensions.x-data-type}}} - } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON{{#modelDeriving}}, {{modelDeriving}}{{/modelDeriving}}){{/isAlias}}{{^isAlias}} + } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON{{#modelDeriving}}, {{.}}{{/modelDeriving}}){{/isAlias}}{{^isAlias}} data {{classname}} = {{classname}} - { {{#vars}}{{name}} :: {{#x-strictFields}}!({{/x-strictFields}}{{^required}}Maybe {{/required}}{{{vendorExtensions.x-data-type}}}{{#x-strictFields}}){{/x-strictFields}} -- ^ {{#required}}/Required/ {{/required}}{{#isReadOnly}}/ReadOnly/ {{/isReadOnly}}"{{baseName}}"{{#description}} - {{description}}{{/description}}{{^-last}} + { {{#vars}}{{name}} :: {{#x-strictFields}}!({{/x-strictFields}}{{^required}}Maybe {{/required}}{{{vendorExtensions.x-data-type}}}{{#x-strictFields}}){{/x-strictFields}} -- ^ {{#required}}/Required/ {{/required}}{{#isReadOnly}}/ReadOnly/ {{/isReadOnly}}"{{baseName}}"{{#description}} - {{.}}{{/description}}{{^-last}} , {{/-last}}{{/vars}} - } deriving (P.Show, P.Eq, P.Typeable{{#modelDeriving}}, {{modelDeriving}}{{/modelDeriving}}){{/isAlias}} + } deriving (P.Show, P.Eq, P.Typeable{{#modelDeriving}}, {{.}}{{/modelDeriving}}){{/isAlias}} {{^isAlias}}-- | FromJSON {{classname}} instance A.FromJSON {{classname}} where @@ -189,7 +189,7 @@ instance AuthMethod {{name}} where applyAuthMethod _ a@({{name}} secret) req = P.pure $ if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) + then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) & L.over rAuthTypesL (P.filter (/= P.typeOf a)) else req diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/README.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/README.mustache index deec0c0cacbc..acd5efa0426b 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/README.mustache @@ -15,7 +15,7 @@ stack haddock ``` which will generate docs for this lib in the `docs` folder. -To generate the docs in the normal location (to enable hyperlinks to external libs), remove +To generate the docs in the normal location (to enable hyperlinks to external libs), remove ``` build: haddock-arguments: @@ -82,7 +82,7 @@ These options allow some customization of the code generation process. An example setting _dateTimeFormat_ and _strictFields_: ``` -java -jar openapi-generator-cli.jar generate -i petstore.yaml -g haskell-http-client -o output/haskell-http-client --additional-properties=dateTimeFormat="%Y-%m-%dT%H:%M:%S%Q%z" --additional-properties=strictFields=false +java -jar openapi-generator-cli.jar generate -i petstore.yaml -g haskell-http-client -o output/haskell-http-client --additional-properties=dateTimeFormat="%Y-%m-%dT%H:%M:%S%Q%z" --additional-properties=strictFields=false ``` View the full list of Codegen "config option" parameters with the command: @@ -136,10 +136,10 @@ in GHCi or via the Haddocks. * optional non-body parameters are included by using `applyOptionalParam` * optional body parameters are set by using `setBodyParam` -Example code generated for pretend _addFoo_ operation: +Example code generated for pretend _addFoo_ operation: ```haskell -data AddFoo +data AddFoo instance Consumes AddFoo MimeJSON instance Produces AddFoo MimeJSON instance Produces AddFoo MimeXML @@ -182,14 +182,14 @@ the config, it will be applied to the request. ```haskell mgr <- newManager defaultManagerSettings -config0 <- withStdoutLogging =<< newConfig +config0 <- withStdoutLogging =<< newConfig let config = config0 `addAuthMethod` AuthOAuthFoo "secret-key" -let addFooRequest = - addFoo - (ContentType MimeJSON) - (Accept MimeXML) +let addFooRequest = + addFoo + (ContentType MimeJSON) + (Accept MimeXML) (ParamBar paramBar) (ParamQux paramQux) modelBaz diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/git_push.sh.mustache index 8b3f689c9121..f0bed5bd8415 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/tests/Instances.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/tests/Instances.mustache index dfa64cbb9296..ca4bcf426712 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/tests/Instances.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/tests/Instances.mustache @@ -72,7 +72,7 @@ instance Arbitrary A.Value where sizedObject n = liftM (A.object . map mapF) $ replicateM n $ (,) <$> (arbitrary :: Gen String) <*> simpleAndArrays - + -- | Checks if a given list has no duplicates in _O(n log n)_. hasNoDups :: (Ord a) @@ -87,7 +87,7 @@ hasNoDups = go Set.empty instance ApproxEq TI.Day where (=~) = (==) - + arbitraryReduced :: Arbitrary a => Int -> Gen a arbitraryReduced n = resize (n `div` 2) arbitrary @@ -104,7 +104,7 @@ arbitraryReducedMaybeValue n = do else return generated -- * Models - + {{#models}} {{#model}} {{^isEnum}} diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/bodyParam.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/bodyParam.mustache index 006149abf79b..1c3e14a80905 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/bodyParam.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/bodyParam.mustache @@ -1,3 +1,3 @@ {{#isBodyParam}}
{{baseName}} {{#baseType}}{{baseType}}{{/baseType}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Body Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}}{{/defaultValue}}
{{/isBodyParam}} +
Body Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{.}}}{{/defaultValue}}
{{/isBodyParam}} diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/formParam.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/formParam.mustache index 19e3fddab8ab..bea19ea953ba 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/formParam.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/formParam.mustache @@ -1,3 +1,3 @@ {{#isFormParam}}
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Form Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/isFormParam}} \ No newline at end of file +
Form Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{.}}} {{/defaultValue}}{{#dataFormat}}format: {{{.}}}{{/dataFormat}}
{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/headerParam.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/headerParam.mustache index 7f5d4efc1408..6c6614b0945e 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/headerParam.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/headerParam.mustache @@ -1,3 +1,3 @@
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Header Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
+
Header Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{.}}} {{/defaultValue}}{{#dataFormat}}format: {{{.}}}{{/dataFormat}}
diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/index.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/index.mustache index eb13cf63fc29..a5ad68cc9c8f 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/index.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/index.mustache @@ -11,8 +11,8 @@
{{{appDescription}}}
{{#infoUrl}}
More information: {{{infoUrl}}}
{{/infoUrl}} {{#infoEmail}}
Contact Info: {{{infoEmail}}}
{{/infoEmail}} - {{#version}}
Version: {{{version}}}
{{/version}} - {{#basePathWithoutHost}}
BasePath:{{basePathWithoutHost}}
{{/basePathWithoutHost}} + {{#version}}
Version: {{{.}}}
{{/version}} + {{#basePathWithoutHost}}
BasePath:{{.}}
{{/basePathWithoutHost}}
{{{licenseInfo}}}
{{{licenseUrl}}}

Access

@@ -155,7 +155,7 @@
    {{#models}} {{#model}} -
  1. {{name}}{{#title}} - {{title}}{{/title}}
  2. +
  3. {{name}}{{#title}} - {{.}}{{/title}}
  4. {{/model}} {{/models}}
@@ -163,10 +163,10 @@ {{#models}} {{#model}}
-

{{name}}{{#title}} - {{title}}{{/title}} Up

- {{#unescapedDescription}}
{{unescapedDescription}}
{{/unescapedDescription}} +

{{name}}{{#title}} - {{.}}{{/title}} Up

+ {{#unescapedDescription}}
{{.}}
{{/unescapedDescription}}
- {{#vars}}
{{name}} {{^required}}(optional){{/required}}
{{^isPrimitiveType}}{{dataType}}{{/isPrimitiveType}} {{unescapedDescription}} {{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
+ {{#vars}}
{{name}} {{^required}}(optional){{/required}}
{{^isPrimitiveType}}{{dataType}}{{/isPrimitiveType}} {{unescapedDescription}} {{#dataFormat}}format: {{{.}}}{{/dataFormat}}
{{#isEnum}}
Enum:
{{#_enum}}
{{this}}
{{/_enum}} diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/pathParam.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/pathParam.mustache index df8d99204005..4c21c3f480a2 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/pathParam.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/pathParam.mustache @@ -1,3 +1,3 @@ {{#isPathParam}}
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Path Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/isPathParam}} \ No newline at end of file +
Path Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{.}}} {{/defaultValue}}{{#dataFormat}}format: {{{.}}}{{/dataFormat}}
{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/queryParam.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/queryParam.mustache index 79f7ab2b8c6a..ee15a268a248 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/queryParam.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/queryParam.mustache @@ -1,3 +1,3 @@ {{#isQueryParam}}
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Query Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/isQueryParam}} \ No newline at end of file +
Query Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{.}}} {{/defaultValue}}{{#dataFormat}}format: {{{.}}}{{/dataFormat}}
{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache b/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache index 5ff3aa02980a..10af1ef7d195 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache @@ -200,7 +200,7 @@

API and SDK Documentation

{{#version}} -
Version: {{{version}}}
+
Version: {{{.}}}
{{/version}}
@@ -492,10 +492,10 @@ {{#headers}} - {{#name}}{{name}}{{/name}} + {{name}} {{#datatype}}{{dataType}}{{/datatype}} - {{#dataFormat}}{{dataFormat}}{{/dataFormat}} - {{#description}}{{description}}{{/description}} + {{dataFormat}} + {{description}} {{/headers}} @@ -523,10 +523,10 @@ {{/infoEmail}}

{{#licenseInfo}} -
{{{licenseInfo}}}
+
{{{.}}}
{{/licenseInfo}} {{#licenseUrl}} -
{{{licenseUrl}}}
+
{{{.}}}
{{/licenseUrl}}
diff --git a/modules/openapi-generator/src/main/resources/htmlDocs2/js_jsonformatter.mustache b/modules/openapi-generator/src/main/resources/htmlDocs2/js_jsonformatter.mustache index 3936dc851493..e3bcee884710 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs2/js_jsonformatter.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs2/js_jsonformatter.mustache @@ -497,7 +497,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a