-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.0.0`):
+[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.1.0`):
[](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds)
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
@@ -60,6 +60,8 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
[](https://www.finbourne.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
[](https://bump.sh/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
[](https://www.bileto.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
+[](https://www.bairesdev.com/sponsoring-open-source-projects/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
+[](https://www.dm-jobs.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
#### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS and Checkly for sponsoring the API monitoring
@@ -73,11 +75,11 @@ 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.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.x, 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, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **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 (9.x - 16.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** |
+| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.1, .NET Core 3.1, .NET 5.0. Libraries: RestSharp, GenericHost, HttpClient), **C++** (Arduino, cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Apache HttpClient 4.x, Apache HttpClient 5.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, Helidon), **Jetbrains HTTP Client**, **Julia**, **k6**, **Kotlin**, **Lua**, **N4JS**, **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 (9.x - 16.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs), **XoJo**, **Zapier** |
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, Azure Functions), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin, Echo), **Haskell** (Servant, Yesod), **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/), [Apache Camel](https://camel.apache.org/), [Helidon](https://helidon.io/)), **Julia**, **Kotlin** (Spring Boot, [Ktor](https://github.com/ktorio/ktor), [Vert.x](https://vertx.io/)), **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](https://openapi-generator.tech/docs/generators/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** |
+| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Postman Collection**, **Protocol Buffer**, **WSDL** |
## Table of contents
@@ -115,12 +117,13 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
| OpenAPI Generator Version | Release Date | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
-| 7.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.0.0-SNAPSHOT/) | Jul/Aug 2023 | Major release with breaking changes (no fallback) |
-| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) (latest stable release) | 11.05.2023 | Minor release with breaking changes (with fallback) |
+| 7.1.0 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.1.0-SNAPSHOT/) | 18.10.2023 | Minor release with breaking changes (with fallback) |
+| [7.0.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.0.1) (latest stable release) | 18.09.2023 | Patch release (enhancements, bug fixes, etc) |
+| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) | 11.05.2023 | Minor release with breaking changes (with fallback) |
| [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0) | 31.01.2022 | Minor release with breaking changes (with fallback) |
| [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
+OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0, 3.1 (beta support)
(We do not publish daily/nightly build. Please use SNAPSHOT instead)
@@ -178,16 +181,16 @@ See the different versions of the [openapi-generator-cli](https://search.maven.o
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
-JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar`
+JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.1/openapi-generator-cli-7.0.1.jar`
For **Mac/Linux** users:
```sh
-wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.6.0/openapi-generator-cli-6.6.0.jar -O openapi-generator-cli.jar
+wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.1/openapi-generator-cli-7.0.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/6.6.0/openapi-generator-cli-6.6.0.jar
+Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.1/openapi-generator-cli-7.0.1.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
@@ -422,7 +425,7 @@ openapi-generator-cli version
To use a specific version of "openapi-generator-cli"
```sh
-openapi-generator-cli version-manager set 6.6.0
+openapi-generator-cli version-manager set 7.0.1
```
Or install it as dev-dependency:
@@ -446,7 +449,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/6.6.0/openapi-generator-cli-6.6.0.jar)
+You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.0.1/openapi-generator-cli-7.0.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`
@@ -927,12 +930,9 @@ OpenAPI Generator core team members are contributors who have been making signif
* [@cbornet](https://github.com/cbornet) (2016/05)
* [@jmini](https://github.com/jmini) (2018/04) [:heart:](https://www.patreon.com/jmini)
* [@etherealjoy](https://github.com/etherealjoy) (2019/06)
-* [@spacether](https://github.com/spacether) (2020/05) [:heart:][spacether sponsorship]
:heart: = Link to support the contributor directly
-[spacether sponsorship]: https://github.com/sponsors/spacether/
-
#### Template Creator
**NOTE**: Embedded templates are only supported in _Mustache_ format. Support for all other formats is experimental and subject to change at any time.
@@ -1003,8 +1003,10 @@ Here is a list of template creators:
* PowerShell (refactored in 5.0.0): @wing328
* Python: @spacether [:heart:][spacether sponsorship]
* Python-Experimental: @spacether [:heart:][spacether sponsorship]
+ * Python (refactored in 7.0.0): @wing328
* R: @ramnov
* Ruby (Faraday): @meganemura @dkliban
+ * Ruby (HTTPX): @honeyryderchuck
* Rust: @farcaller
* Rust (rust-server): @metaswitch
* Scala (scalaz & http4s): @tbrown1979
@@ -1139,7 +1141,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) |
| C | @zhemant (2018/11) @ityuhui (2019/12) @michelealbano (2020/03) |
| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) |
-| C# | @mandrean (2017/08) @frankyjuang (2019/09) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05) @iBicha (2023/07) |
+| C# | @mandrean (2017/08) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05) @iBicha (2023/07) |
| Clojure | |
| Crystal | @cyangle (2021/01) |
| Dart | @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) @ahmednfwela (2021/08) |
@@ -1152,8 +1154,8 @@ If you want to join the committee, please kindly apply by sending an email to te
| GraphQL | @renepardon (2018/12) |
| Groovy | |
| Haskell | |
-| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) |
-| Java Spring | @cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09) |
+| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @martin-mfg (2023/08) |
+| Java Spring | @cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09) @martin-mfg (2023/08) |
| JMeter | @kannkyo (2021/01) |
| Jetbrains HTTP Client | @jlengrand (2023/01) |
| Julia | @tanmaykm (2023/01) |
@@ -1167,7 +1169,7 @@ If you want to join the committee, please kindly apply by sending an email to te
| Perl | @wing328 (2017/07) [:heart:](https://www.patreon.com/wing328) @yue9944882 (2019/06) |
| PHP | @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), [@ybelenko](https://github.com/ybelenko) (2018/07), @renepardon (2018/12) |
| PowerShell | @wing328 (2020/05) |
-| Python | @spacether (2019/11) [:heart:][spacether sponsorship] @krjakbrjak (2023/02) |
+| Python | @krjakbrjak (2023/02) |
| R | @Ramanth (2019/07) @saigiridhar21 (2019/07) |
| Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) |
| Rust | @frol (2017/07) @farcaller (2017/08) @richardwhiuk (2019/07) @paladinzh (2020/05) @jacob-pro (2022/10) |
@@ -1260,4 +1262,3 @@ See the License for the specific language governing permissions and
limitations under the License.
---
-
diff --git a/appveyor.yml b/appveyor.yml
index 96804576fc0d..c3d56f5f7de9 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -13,7 +13,7 @@ install:
- cmd: docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
- ps: Start-Sleep -s 120
- ps: $PSVersionTable.PSVersion
- - ps: Install-Module -Name Pester -Force -Scope CurrentUser
+ - ps: Install-Module -Name Pester -Force -Scope CurrentUser -SkipPublisherCheck
build_script:
- dotnet --info
# build C# aspnetcore 5.0 server
diff --git a/bin/configs/c.yaml b/bin/configs/c.yaml
index 378b5d1f3679..2759591e2acf 100644
--- a/bin/configs/c.yaml
+++ b/bin/configs/c.yaml
@@ -2,3 +2,6 @@ generatorName: c
outputDir: samples/client/petstore/c
inputSpec: modules/openapi-generator/src/test/resources/2_0/c/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/C-libcurl
+modelNameMappings:
+ another_model: MappedModel
+ another_property: mappedProperty
diff --git a/bin/configs/crystal.yaml b/bin/configs/crystal.yaml
index c578838173ac..db88d8bfd9b5 100644
--- a/bin/configs/crystal.yaml
+++ b/bin/configs/crystal.yaml
@@ -7,3 +7,12 @@ additionalProperties:
moduleName: Petstore
shardName: petstore
strictSpecBehavior: false
+modelNameMappings:
+ PropertyNameMapping: AnotherPropertyNameMapping
+nameMappings:
+ _type: underscore_type
+ type_: type_with_underscore
+ type-: type_with_dash
+parameterNameMappings:
+ _type: underscore_type
+ type_: type_with_underscore
diff --git a/bin/configs/csharp-generichost-latest-nrt-useSourceGeneration.yaml b/bin/configs/csharp-generichost-latest-nrt-useSourceGeneration.yaml
new file mode 100644
index 000000000000..392e76b045f1
--- /dev/null
+++ b/bin/configs/csharp-generichost-latest-nrt-useSourceGeneration.yaml
@@ -0,0 +1,12 @@
+# for csharp generichost
+generatorName: csharp
+outputDir: samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration
+inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
+library: generichost
+templateDir: modules/openapi-generator/src/main/resources/csharp
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+ useCompareNetObjects: true
+ disallowAdditionalPropertiesIfNotPresent: false
+ useSourceGeneration: true
+ packageName: UseSourceGeneration
diff --git a/bin/configs/csharp-restsharp-name-mappings.yaml b/bin/configs/csharp-restsharp-name-mappings.yaml
deleted file mode 100644
index 6e87c97a2e05..000000000000
--- a/bin/configs/csharp-restsharp-name-mappings.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-generatorName: csharp
-outputDir: samples/client/petstore/csharp-restsharp-name-parameter-mappings
-inputSpec: modules/openapi-generator/src/test/resources/3_0/name-parameter-mappings.yaml
-templateDir: modules/openapi-generator/src/main/resources/csharp
-nameMappings:
- _type: UnderscoreType
- type_: TypeWithUnderscore
- http_debug_operation: HttpDebugOperation
-parameterNameMappings:
- _type: UnderscoreType
- type_: TypeWithUnderscore
- http_debug_operation: HttpDebugOperation
-additionalProperties:
- packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
- hideGenerationTimestamp: "true"
diff --git a/bin/configs/csharp-restsharp-net6.0-name-mappings.yaml b/bin/configs/csharp-restsharp-net6.0-name-mappings.yaml
new file mode 100644
index 000000000000..56af6a800cb7
--- /dev/null
+++ b/bin/configs/csharp-restsharp-net6.0-name-mappings.yaml
@@ -0,0 +1,18 @@
+generatorName: csharp
+outputDir: samples/client/petstore/csharp-restsharp-name-parameter-mappings
+inputSpec: modules/openapi-generator/src/test/resources/3_0/name-parameter-mappings.yaml
+templateDir: modules/openapi-generator/src/main/resources/csharp
+nameMappings:
+ _type: UnderscoreType
+ type_: TypeWithUnderscore
+ http_debug_operation: HttpDebugOperation
+parameterNameMappings:
+ _type: UnderscoreType
+ type_: TypeWithUnderscore
+ http_debug_operation: HttpDebugOperation
+modelNameMappings:
+ Environment: Env
+additionalProperties:
+ packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
+ hideGenerationTimestamp: "true"
+ targetFramework: net6.0
diff --git a/bin/configs/elixir.yaml b/bin/configs/elixir.yaml
index a287f44705b0..917661865ddb 100644
--- a/bin/configs/elixir.yaml
+++ b/bin/configs/elixir.yaml
@@ -4,3 +4,10 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-e
templateDir: modules/openapi-generator/src/main/resources/elixir
additionalProperties:
invokerPackage: OpenapiPetstore
+modelNameMappings:
+ DeprecatedObject: DeprecatedModel
+# the following options have no effect on elixir client gen which uses baseName
+nameMappings:
+ deprecatedRef: deprecatedReference
+parameterNameMapping:
+ ioutils: ioutils_parameter
diff --git a/bin/configs/go-echo-api.yaml b/bin/configs/go-echo-api.yaml
new file mode 100644
index 000000000000..1d6b3be9b5ca
--- /dev/null
+++ b/bin/configs/go-echo-api.yaml
@@ -0,0 +1,6 @@
+generatorName: go
+outputDir: samples/client/echo_api/go
+inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
+templateDir: modules/openapi-generator/src/main/resources/go
+additionalProperties:
+ hideGenerationTimestamp: "true"
diff --git a/bin/configs/go-server-chi-api-server-test.yaml b/bin/configs/go-server-chi-api-server-test.yaml
new file mode 100644
index 000000000000..9248d16e2581
--- /dev/null
+++ b/bin/configs/go-server-chi-api-server-test.yaml
@@ -0,0 +1,9 @@
+generatorName: go-server
+outputDir: samples/openapi3/server/petstore/go/go-petstore
+inputSpec: modules/openapi-generator/src/test/resources/3_0/go-server/petstore_with_test_endpoint.yaml
+templateDir: modules/openapi-generator/src/main/resources/go-server
+additionalProperties:
+ hideGenerationTimestamp: "true"
+ packageName: petstoreserver
+ addResponseHeaders: true
+ router: "chi"
diff --git a/bin/configs/go-server-chi-api-server.yaml b/bin/configs/go-server-chi-api-server.yaml
index 16db86a3d62b..b60eb9c206cf 100644
--- a/bin/configs/go-server-chi-api-server.yaml
+++ b/bin/configs/go-server-chi-api-server.yaml
@@ -1,6 +1,6 @@
generatorName: go-server
outputDir: samples/server/petstore/go-chi-server
-inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+inputSpec: modules/openapi-generator/src/test/resources/3_0/go-server/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/go-server
additionalProperties:
hideGenerationTimestamp: "true"
diff --git a/bin/configs/go-server-required.yaml b/bin/configs/go-server-required.yaml
deleted file mode 100644
index fd90bbbeb83a..000000000000
--- a/bin/configs/go-server-required.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-generatorName: go-server
-outputDir: samples/server/petstore/go-server-required
-inputSpec: modules/openapi-generator/src/test/resources/3_0/server-required.yaml
-templateDir: modules/openapi-generator/src/main/resources/go-server
-additionalProperties:
- hideGenerationTimestamp: "true"
- packageName: petstoreserver
- addResponseHeaders: true
- router: "chi"
diff --git a/bin/configs/haskell-servant.yaml b/bin/configs/haskell-servant.yaml
index 1419e5490979..9c88686b3d7c 100644
--- a/bin/configs/haskell-servant.yaml
+++ b/bin/configs/haskell-servant.yaml
@@ -1,4 +1,4 @@
generatorName: haskell
outputDir: samples/server/petstore/haskell-servant
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
+inputSpec: modules/openapi-generator/src/test/resources/3_0/haskell/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/haskell-servant
diff --git a/bin/configs/haskell-yesod-petstore-new.yaml b/bin/configs/haskell-yesod-petstore-new.yaml
deleted file mode 100644
index f7ae3890cdf9..000000000000
--- a/bin/configs/haskell-yesod-petstore-new.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-generatorName: haskell-yesod
-outputDir: samples/server/petstore/haskell-yesod
-inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
-templateDir: modules/openapi-generator/src/main/resources/haskell-yesod
-additionalProperties:
- hideGenerationTimestamp: "true"
diff --git a/bin/configs/haskell-yesod.yaml b/bin/configs/haskell-yesod.yaml
new file mode 100644
index 000000000000..60763aa57937
--- /dev/null
+++ b/bin/configs/haskell-yesod.yaml
@@ -0,0 +1,6 @@
+generatorName: haskell-yesod
+outputDir: samples/server/petstore/haskell-yesod
+inputSpec: modules/openapi-generator/src/test/resources/3_0/haskell/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/haskell-yesod
+additionalProperties:
+ hideGenerationTimestamp: "true"
diff --git a/bin/configs/java-jersey1.yaml b/bin/configs/java-jersey1.yaml
deleted file mode 100644
index 26cf1f0e5c1f..000000000000
--- a/bin/configs/java-jersey1.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-generatorName: java
-outputDir: samples/client/petstore/java/jersey1
-library: jersey1
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
-templateDir: modules/openapi-generator/src/main/resources/Java
-additionalProperties:
- hideGenerationTimestamp: "true"
- artifactId: petstore-java-client-jersey1
diff --git a/bin/configs/java-microprofile-rest-client-3.0-jackson-with-xml.yaml b/bin/configs/java-microprofile-rest-client-3.0-jackson-with-xml.yaml
new file mode 100644
index 000000000000..af31232ee24b
--- /dev/null
+++ b/bin/configs/java-microprofile-rest-client-3.0-jackson-with-xml.yaml
@@ -0,0 +1,11 @@
+generatorName: java
+outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml
+library: microprofile
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+withXml: true
+additionalProperties:
+ serializationLibrary: jackson
+ artifactId: microprofile-rest-client-3-jackson-with-xml
+ configKey: petstore
+ microprofileRestClientVersion: "3.0"
\ No newline at end of file
diff --git a/bin/configs/java-microprofile-rest-client-3.0-jackson.yaml b/bin/configs/java-microprofile-rest-client-3.0-jackson.yaml
new file mode 100644
index 000000000000..92d945a3cb93
--- /dev/null
+++ b/bin/configs/java-microprofile-rest-client-3.0-jackson.yaml
@@ -0,0 +1,10 @@
+generatorName: java
+outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson
+library: microprofile
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ serializationLibrary: jackson
+ artifactId: microprofile-rest-client-3-jackson
+ configKey: petstore
+ microprofileRestClientVersion: "3.0"
\ No newline at end of file
diff --git a/bin/configs/java-native-echo-api.yaml b/bin/configs/java-native-echo-api.yaml
index dd14faddab06..b782fe01fed2 100644
--- a/bin/configs/java-native-echo-api.yaml
+++ b/bin/configs/java-native-echo-api.yaml
@@ -6,3 +6,8 @@ templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: echo-api-native
hideGenerationTimestamp: "true"
+
+typeMappings:
+ OffsetDateTime: "Instant"
+importMappings:
+ OffsetDateTime: "java.time.Instant"
diff --git a/bin/configs/java-okhttp-gson-3.1.yaml b/bin/configs/java-okhttp-gson-3.1.yaml
new file mode 100644
index 000000000000..5ba207947417
--- /dev/null
+++ b/bin/configs/java-okhttp-gson-3.1.yaml
@@ -0,0 +1,16 @@
+generatorName: java
+outputDir: samples/client/petstore/java/okhttp-gson-3.1
+library: okhttp-gson
+inputSpec: modules/openapi-generator/src/test/resources/3_1/java/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+nameMappings:
+ _type: underscoreType
+ type_: typeWithUnderscore
+parameterNameMappings:
+ _type: underscoreType
+ type_: typeWithUnderscore
+additionalProperties:
+ artifactId: petstore-okhttp-gson-31
+ hideGenerationTimestamp: "true"
+ useOneOfDiscriminatorLookup: "true"
+ disallowAdditionalPropertiesIfNotPresent: false
diff --git a/bin/configs/java-okhttp-gson-streaming.yaml b/bin/configs/java-okhttp-gson-streaming.yaml
index 34da56581a74..9e75c93bac4c 100644
--- a/bin/configs/java-okhttp-gson-streaming.yaml
+++ b/bin/configs/java-okhttp-gson-streaming.yaml
@@ -7,3 +7,4 @@ additionalProperties:
artifactId: petstore-okhttp-gson
hideGenerationTimestamp: "true"
supportStreaming: true
+ serializableModel: true
diff --git a/bin/configs/java-resteasy.yaml b/bin/configs/java-resteasy.yaml
index a6b099248583..6ae01b629356 100644
--- a/bin/configs/java-resteasy.yaml
+++ b/bin/configs/java-resteasy.yaml
@@ -1,8 +1,8 @@
generatorName: java
outputDir: samples/client/petstore/java/resteasy
-library: resteasy
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: petstore-resteasy
hideGenerationTimestamp: "true"
+ library: resteasy
diff --git a/bin/configs/java-resttemplate-useAbstractionForFiles.yaml b/bin/configs/java-resttemplate-useAbstractionForFiles.yaml
new file mode 100644
index 000000000000..af3af76427ff
--- /dev/null
+++ b/bin/configs/java-resttemplate-useAbstractionForFiles.yaml
@@ -0,0 +1,9 @@
+generatorName: java
+outputDir: samples/client/others/java/resttemplate-useAbstractionForFiles
+library: resttemplate
+inputSpec: modules/openapi-generator/src/test/resources/3_0/issue13146_file_abstraction_response.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ artifactId: file-resttemplate
+ hideGenerationTimestamp: "true"
+ useAbstractionForFiles: true
diff --git a/bin/configs/java-resttemplate-withXml.yaml b/bin/configs/java-resttemplate-withXml.yaml
index c0122422f0a0..6733aab84006 100644
--- a/bin/configs/java-resttemplate-withXml.yaml
+++ b/bin/configs/java-resttemplate-withXml.yaml
@@ -1,7 +1,7 @@
generatorName: java
outputDir: samples/client/petstore/java/resttemplate-withXml
library: resttemplate
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
java8: true
diff --git a/bin/configs/java-resttemplate.yaml b/bin/configs/java-resttemplate.yaml
index 477b09658db3..e71609cbcf36 100644
--- a/bin/configs/java-resttemplate.yaml
+++ b/bin/configs/java-resttemplate.yaml
@@ -1,7 +1,7 @@
generatorName: java
outputDir: samples/client/petstore/java/resttemplate
library: resttemplate
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: petstore-resttemplate
diff --git a/bin/configs/java-undertow-server-java-undertow.yaml b/bin/configs/java-undertow-server-java-undertow.yaml
deleted file mode 100644
index 2cbb1160f171..000000000000
--- a/bin/configs/java-undertow-server-java-undertow.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-generatorName: java-undertow-server
-outputDir: samples/server/petstore/java-undertow
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
-templateDir: modules/openapi-generator/src/main/resources/java-undertow-server
-additionalProperties:
- hideGenerationTimestamp: "true"
diff --git a/bin/configs/java-undertow-server.yaml b/bin/configs/java-undertow-server.yaml
new file mode 100644
index 000000000000..0abaa522f85a
--- /dev/null
+++ b/bin/configs/java-undertow-server.yaml
@@ -0,0 +1,6 @@
+generatorName: java-undertow-server
+outputDir: samples/server/petstore/java-undertow
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/java-undertow-server
+additionalProperties:
+ hideGenerationTimestamp: "true"
diff --git a/bin/configs/java-vertx.yaml b/bin/configs/java-vertx.yaml
index cf019b5da88c..6b85e9b8fa7e 100644
--- a/bin/configs/java-vertx.yaml
+++ b/bin/configs/java-vertx.yaml
@@ -1,7 +1,7 @@
generatorName: java
outputDir: samples/client/petstore/java/vertx
library: vertx
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: petstore-vertx
diff --git a/bin/configs/java-webclient-useAbstractionForFiles.yaml b/bin/configs/java-webclient-useAbstractionForFiles.yaml
new file mode 100644
index 000000000000..6480f6f3e0de
--- /dev/null
+++ b/bin/configs/java-webclient-useAbstractionForFiles.yaml
@@ -0,0 +1,9 @@
+generatorName: java
+outputDir: samples/client/others/java/webclient-useAbstractionForFiles
+library: webclient
+inputSpec: modules/openapi-generator/src/test/resources/3_0/issue13146_file_abstraction_response.yaml
+templateDir: modules/openapi-generator/src/main/resources/Java
+additionalProperties:
+ artifactId: file-webclient
+ hideGenerationTimestamp: "true"
+ useAbstractionForFiles: true
diff --git a/bin/configs/javascript-es6.yaml b/bin/configs/javascript-es6.yaml
index 67f013b0c513..bc9562f93e76 100644
--- a/bin/configs/javascript-es6.yaml
+++ b/bin/configs/javascript-es6.yaml
@@ -5,3 +5,10 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/javascript/petstore-
templateDir: modules/openapi-generator/src/main/resources/Javascript
additionalProperties:
appName: PetstoreClient
+modelNameMappings:
+ HealthCheckResult: HealthCheckStatus
+parameterNameMappings:
+ query_1: queryOne
+# the following has no effect as js client gen use baseName directly
+nameMappings:
+ NullableMessage: nullable_field
diff --git a/bin/configs/jaxrs-jersey-jersey1-useTags.yaml b/bin/configs/jaxrs-jersey-jersey1-useTags.yaml
deleted file mode 100644
index 98c76c0e4511..000000000000
--- a/bin/configs/jaxrs-jersey-jersey1-useTags.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-generatorName: jaxrs-jersey
-outputDir: samples/server/petstore/jaxrs/jersey1-useTags
-library: jersey1
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
-templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS
-additionalProperties:
- artifactId: jaxrs-jersey1-useTags
- hideGenerationTimestamp: "true"
- serverPort: "8082"
- useTags: "true"
diff --git a/bin/configs/jaxrs-jersey-jersey1.yaml b/bin/configs/jaxrs-jersey-jersey1.yaml
deleted file mode 100644
index 8df27c59be78..000000000000
--- a/bin/configs/jaxrs-jersey-jersey1.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-generatorName: jaxrs-jersey
-outputDir: samples/server/petstore/jaxrs/jersey1
-library: jersey1
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
-templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS
-additionalProperties:
- artifactId: jaxrs-jersey1-server
- hideGenerationTimestamp: "true"
- serverPort: "8082"
diff --git a/bin/configs/jaxrs-jersey-jersey3.yaml b/bin/configs/jaxrs-jersey-jersey3.yaml
new file mode 100644
index 000000000000..87a4fb6cc23f
--- /dev/null
+++ b/bin/configs/jaxrs-jersey-jersey3.yaml
@@ -0,0 +1,9 @@
+generatorName: jaxrs-jersey
+outputDir: samples/server/petstore/jaxrs/jersey3
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS
+library: jersey3
+additionalProperties:
+ artifactId: jaxrs-jersey3-petstore-server
+ hideGenerationTimestamp: "true"
+ serverPort: "8082"
\ No newline at end of file
diff --git a/bin/configs/julia-client-petstore-new.yaml b/bin/configs/julia-client-petstore-new.yaml
index a08bf6c2b5c2..ebe6c0b0c980 100644
--- a/bin/configs/julia-client-petstore-new.yaml
+++ b/bin/configs/julia-client-petstore-new.yaml
@@ -1,9 +1,13 @@
generatorName: julia-client
outputDir: samples/client/petstore/julia
-inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+inputSpec: modules/openapi-generator/src/test/resources/3_0/julia/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/julia-client
additionalProperties:
hideGenerationTimestamp: "true"
packageName: OpenAPIGenPetStoreClient
exportOperations: "true"
- exportModels: "true"
\ No newline at end of file
+ exportModels: "true"
+modelNameMappings:
+ another_model: MappedModel
+nameMappings:
+ another_property: mappedProperty
diff --git a/bin/configs/julia-server-petstore-new.yaml b/bin/configs/julia-server-petstore-new.yaml
index 26159cdbda50..9e86f99dfb5d 100644
--- a/bin/configs/julia-server-petstore-new.yaml
+++ b/bin/configs/julia-server-petstore-new.yaml
@@ -1,9 +1,9 @@
generatorName: julia-server
outputDir: samples/server/petstore/julia
-inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+inputSpec: modules/openapi-generator/src/test/resources/3_0/julia/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/julia-server
additionalProperties:
hideGenerationTimestamp: "true"
packageName: OpenAPIGenPetStoreServer
exportOperations: "true"
- exportModels: "true"
\ No newline at end of file
+ exportModels: "true"
diff --git a/bin/configs/kotlin-jvm-jackson.yaml b/bin/configs/kotlin-jvm-jackson.yaml
new file mode 100644
index 000000000000..2165f75eac2c
--- /dev/null
+++ b/bin/configs/kotlin-jvm-jackson.yaml
@@ -0,0 +1,9 @@
+generatorName: kotlin
+outputDir: samples/client/petstore/kotlin-jvm-jackson
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/kotlin-client
+additionalProperties:
+ artifactId: kotlin-petstore-jvm-jackson
+ enumUnknownDefaultCase: true
+ serializationLibrary: jackson
+ library: jvm-retrofit2
diff --git a/bin/configs/kotlin-jvm-okhttp-parameter-tests.yaml b/bin/configs/kotlin-jvm-okhttp-parameter-tests.yaml
new file mode 100644
index 000000000000..1f1a37de2198
--- /dev/null
+++ b/bin/configs/kotlin-jvm-okhttp-parameter-tests.yaml
@@ -0,0 +1,7 @@
+generatorName: kotlin
+outputDir: samples/client/others/kotlin-jvm-okhttp-parameter-tests
+library: jvm-okhttp4
+inputSpec: modules/openapi-generator/src/test/resources/3_0/parameter-test-spec.yaml
+templateDir: modules/openapi-generator/src/main/resources/kotlin-client
+additionalProperties:
+ artifactId: kotlin-petstore-okhttp4-parameter-tests
diff --git a/bin/configs/kotlin-server-jaxrs-spec-parameter-tests.yaml b/bin/configs/kotlin-server-jaxrs-spec-parameter-tests.yaml
new file mode 100644
index 000000000000..948d739d995d
--- /dev/null
+++ b/bin/configs/kotlin-server-jaxrs-spec-parameter-tests.yaml
@@ -0,0 +1,7 @@
+generatorName: kotlin-server
+outputDir: samples/server/others/kotlin-server/jaxrs-spec
+library: jaxrs-spec
+inputSpec: modules/openapi-generator/src/test/resources/3_0/parameter-test-spec.yaml
+templateDir: modules/openapi-generator/src/main/resources/kotlin-server
+additionalProperties:
+ useCoroutines: "true"
diff --git a/bin/configs/kotlin-spring-default.yaml b/bin/configs/kotlin-spring-default.yaml
new file mode 100644
index 000000000000..c251860d937a
--- /dev/null
+++ b/bin/configs/kotlin-spring-default.yaml
@@ -0,0 +1,14 @@
+generatorName: kotlin-spring
+outputDir: samples/server/petstore/kotlin-spring-default
+library: spring-boot
+inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
+# comment out below to use default settings
+#additionalProperties:
+# documentationProvider: none
+# annotationLibrary: none
+# useSwaggerUI: "false"
+# serviceImplementation: "true"
+# serializableModel: "true"
+# beanValidations: "true"
+# useSpringBoot3: "true"
diff --git a/bin/configs/lua.yaml b/bin/configs/lua.yaml
index 280cf32e7418..0114d8eb793d 100644
--- a/bin/configs/lua.yaml
+++ b/bin/configs/lua.yaml
@@ -4,3 +4,5 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/lua
additionalProperties:
packageName: petstore
+nameMappings:
+ phone: mobile
diff --git a/bin/configs/perl.yaml b/bin/configs/perl.yaml
index 17575b85be0f..3fb7e7b28ec2 100644
--- a/bin/configs/perl.yaml
+++ b/bin/configs/perl.yaml
@@ -4,3 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-e
templateDir: modules/openapi-generator/src/main/resources/perl
additionalProperties:
hideGenerationTimestamp: "true"
+nameMappings:
+ NullableMessage: system_message
+modelNameMappings:
+ DeprecatedObject: DeprecatedModel
diff --git a/bin/configs/php-nextgen-echo-api.yaml b/bin/configs/php-nextgen-echo-api.yaml
new file mode 100644
index 000000000000..ada80ba47001
--- /dev/null
+++ b/bin/configs/php-nextgen-echo-api.yaml
@@ -0,0 +1,6 @@
+generatorName: php-nextgen
+outputDir: samples/client/echo_api/php-nextgen
+inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
+templateDir: modules/openapi-generator/src/main/resources/php-nextgen
+additionalProperties:
+ hideGenerationTimestamp: "true"
diff --git a/bin/configs/php-nextgen.yaml b/bin/configs/php-nextgen.yaml
new file mode 100644
index 000000000000..e8db9d729c2d
--- /dev/null
+++ b/bin/configs/php-nextgen.yaml
@@ -0,0 +1,4 @@
+generatorName: php-nextgen
+outputDir: samples/client/petstore/php-nextgen/OpenAPIClient-php
+inputSpec: modules/openapi-generator/src/test/resources/3_0/php-nextgen/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/php-nextgen
diff --git a/bin/configs/php-psr-18.yaml b/bin/configs/php-psr-18.yaml
new file mode 100644
index 000000000000..0b9b7b0f54e0
--- /dev/null
+++ b/bin/configs/php-psr-18.yaml
@@ -0,0 +1,12 @@
+generatorName: php
+outputDir: samples/client/petstore/php/psr-18
+inputSpec: modules/openapi-generator/src/test/resources/3_0/php/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/php
+library: psr-18
+nameMappings:
+ _type: underscore_type
+ type_: type_with_underscore
+ type-: type_with_dash
+parameterNameMappings:
+ _type: underscore_type
+ type_: type_with_underscore
diff --git a/bin/configs/powershell.yaml b/bin/configs/powershell.yaml
index 9a408c2ad176..3dccae4c8b71 100644
--- a/bin/configs/powershell.yaml
+++ b/bin/configs/powershell.yaml
@@ -14,3 +14,7 @@ additionalProperties:
projectUri: https://github.com/OpenAPITools/openapi-generator
releaseNotes: 'This is a sample project'
tags: 'PetStore,powershell,sdk'
+nameMappings:
+ name_mapping: SomethingElse
+modelNameMappings:
+ model-mapping: NewModel
diff --git a/bin/configs/python-echo-api-disallowAdditionalPropertiesIfNotPresent-true.yaml b/bin/configs/python-echo-api-disallowAdditionalPropertiesIfNotPresent-true.yaml
new file mode 100644
index 000000000000..e91fe1929d18
--- /dev/null
+++ b/bin/configs/python-echo-api-disallowAdditionalPropertiesIfNotPresent-true.yaml
@@ -0,0 +1,7 @@
+generatorName: python
+outputDir: samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true
+inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
+templateDir: modules/openapi-generator/src/main/resources/python
+additionalProperties:
+ hideGenerationTimestamp: "true"
+ disallowAdditionalPropertiesIfNotPresent: "true"
diff --git a/bin/configs/python-flask.yaml b/bin/configs/python-flask.yaml
index c8bc1d08f5d4..570206be2bc1 100644
--- a/bin/configs/python-flask.yaml
+++ b/bin/configs/python-flask.yaml
@@ -1,4 +1,4 @@
generatorName: python-flask
outputDir: samples/server/petstore/python-flask
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
+inputSpec: modules/openapi-generator/src/test/resources/2_0/python-flask/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/python-flask
diff --git a/bin/configs/python-pydantic-v1-aiohttp.yaml b/bin/configs/python-pydantic-v1-aiohttp.yaml
new file mode 100644
index 000000000000..2ba8f2326741
--- /dev/null
+++ b/bin/configs/python-pydantic-v1-aiohttp.yaml
@@ -0,0 +1,8 @@
+generatorName: python-pydantic-v1
+outputDir: samples/openapi3/client/petstore/python-pydantic-v1-aiohttp
+inputSpec: modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/python-pydantic-v1
+library: asyncio
+additionalProperties:
+ packageName: petstore_api
+ mapNumberTo: float
diff --git a/bin/configs/python-pydantic-v1-echo-api.yaml b/bin/configs/python-pydantic-v1-echo-api.yaml
new file mode 100644
index 000000000000..19020abc3b6a
--- /dev/null
+++ b/bin/configs/python-pydantic-v1-echo-api.yaml
@@ -0,0 +1,6 @@
+generatorName: python-pydantic-v1
+outputDir: samples/client/echo_api/python-pydantic-v1
+inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
+templateDir: modules/openapi-generator/src/main/resources/python-pydantic-v1
+additionalProperties:
+ hideGenerationTimestamp: "true"
diff --git a/bin/configs/python-pydantic-v1.yaml b/bin/configs/python-pydantic-v1.yaml
new file mode 100644
index 000000000000..af6786e66333
--- /dev/null
+++ b/bin/configs/python-pydantic-v1.yaml
@@ -0,0 +1,12 @@
+generatorName: python-pydantic-v1
+outputDir: samples/openapi3/client/petstore/python-pydantic-v1
+inputSpec: modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/python-pydantic-v1
+additionalProperties:
+ packageName: petstore_api
+ useOneOfDiscriminatorLookup: "true"
+ disallowAdditionalPropertiesIfNotPresent: false
+ mapNumberTo: StrictFloat
+nameMappings:
+ _type: underscore_type
+ type_: type_with_underscore
diff --git a/bin/configs/r-httr2-client.yaml b/bin/configs/r-httr2-client.yaml
index 15779e26d36c..c842eefa49e4 100644
--- a/bin/configs/r-httr2-client.yaml
+++ b/bin/configs/r-httr2-client.yaml
@@ -4,6 +4,12 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/r/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/r
httpUserAgent: PetstoreAgent
library: httr2
+modelNameMappings:
+ dummy_model: JustModel
+parameterNameMappings:
+ path_array: path_array_parameter
+nameMappings:
+ percent_description: percent
additionalProperties:
packageName: petstore
exceptionPackage: rlang
@@ -11,3 +17,4 @@ additionalProperties:
returnExceptionOnFailure: true
errorObjectType: "ModelApiResponse"
operationIdNaming: snake_case
+
diff --git a/bin/configs/ruby-httpx-echo-api.yaml b/bin/configs/ruby-httpx-echo-api.yaml
new file mode 100644
index 000000000000..f145b27192a4
--- /dev/null
+++ b/bin/configs/ruby-httpx-echo-api.yaml
@@ -0,0 +1,7 @@
+generatorName: ruby
+outputDir: samples/client/echo_api/ruby-httpx
+inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
+templateDir: modules/openapi-generator/src/main/resources/ruby-client
+library: httpx
+additionalProperties:
+ hideGenerationTimestamp: "true"
diff --git a/bin/configs/ruby-httpx.yaml b/bin/configs/ruby-httpx.yaml
new file mode 100644
index 000000000000..9ffe4de2b2d6
--- /dev/null
+++ b/bin/configs/ruby-httpx.yaml
@@ -0,0 +1,10 @@
+generatorName: ruby
+outputDir: samples/client/petstore/ruby-httpx
+library: httpx
+inputSpec: modules/openapi-generator/src/test/resources/3_0/ruby/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/ruby-client
+additionalProperties:
+ gemVersion: 1.0.0
+ moduleName: Petstore
+ gemName: petstore
+ skipFormModel: "true"
diff --git a/bin/configs/scala-pekko-http-server.yaml b/bin/configs/scala-pekko-http-server.yaml
new file mode 100644
index 000000000000..1758feaf615f
--- /dev/null
+++ b/bin/configs/scala-pekko-http-server.yaml
@@ -0,0 +1,7 @@
+generatorName: scala-akka-http-server
+outputDir: samples/server/petstore/scala-pekko-http-server
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/scala-akka-http-server
+additionalProperties:
+ artifactId: openapi-scala-pekko-http-server
+ useApachePekko: true
diff --git a/bin/configs/spring-boot-reactive-noResponseEntity.yaml b/bin/configs/spring-boot-reactive-noResponseEntity.yaml
new file mode 100644
index 000000000000..746184ef2aba
--- /dev/null
+++ b/bin/configs/spring-boot-reactive-noResponseEntity.yaml
@@ -0,0 +1,12 @@
+generatorName: spring
+outputDir: samples/server/petstore/springboot-reactive-noResponseEntity
+inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/JavaSpring
+additionalProperties:
+ groupId: org.openapitools.openapi3
+ artifactId: springboot-reactive-noResponseEntity
+ documentationProvider: springfox
+ reactive: "true"
+ hideGenerationTimestamp: "true"
+ delegatePattern: "true"
+ useResponseEntity: "false"
diff --git a/bin/configs/spring-cloud-deprecated-oas3.yaml b/bin/configs/spring-cloud-deprecated-oas3.yaml
new file mode 100644
index 000000000000..b6d1943ce7ab
--- /dev/null
+++ b/bin/configs/spring-cloud-deprecated-oas3.yaml
@@ -0,0 +1,13 @@
+generatorName: spring
+library: spring-cloud
+outputDir: samples/client/petstore/spring-cloud-deprecated
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-deprecated-fields.yaml
+templateDir: modules/openapi-generator/src/main/resources/JavaSpring
+additionalProperties:
+ groupId: org.openapitools.openapi3
+ documentationProvider: springdoc
+ artifactId: spring-cloud-deprecated
+ interfaceOnly: "true"
+ singleContentTypes: "true"
+ hideGenerationTimestamp: "true"
+ useTags: "true"
diff --git a/bin/configs/springboot-petstore-server-spring-provide-args.yaml b/bin/configs/springboot-petstore-server-spring-provide-args.yaml
new file mode 100644
index 000000000000..09ed7ec421be
--- /dev/null
+++ b/bin/configs/springboot-petstore-server-spring-provide-args.yaml
@@ -0,0 +1,8 @@
+generatorName: spring
+outputDir: samples/server/petstore/springboot-spring-provide-args
+library: spring-boot
+inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-spring-provide-args.yaml
+templateDir: modules/openapi-generator/src/main/resources/JavaSpring
+additionalProperties:
+ artifactId: springboot-spring-provide-args
+ hideGenerationTimestamp: 'true'
diff --git a/bin/configs/unmaintained/openapi3/python-flask-python2.yaml b/bin/configs/unmaintained/openapi3/python-flask-python2.yaml
deleted file mode 100644
index 407389d9121c..000000000000
--- a/bin/configs/unmaintained/openapi3/python-flask-python2.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-generatorName: python-flask
-outputDir: samples/openapi3/server/petstore/python-flask-python2
-inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-object-as-parameter.yaml
-templateDir: modules/openapi-generator/src/main/resources/python-flask
-additionalProperties:
- supportPython2: true
diff --git a/bin/generate-samples.sh b/bin/generate-samples.sh
index b296ba608f37..3f88859f9779 100755
--- a/bin/generate-samples.sh
+++ b/bin/generate-samples.sh
@@ -53,7 +53,7 @@ if [[ ${#files[@]} -eq 1 && "${files[0]}" != *'*'* ]]; then
java ${JAVA_OPTS} -jar "$executable" generate -c ${files[0]} ${args[@]}
else
echo "Please press CTRL+C to stop or the script will continue in 5 seconds."
- sleep 5
+ #sleep 5
if [ ${#files[@]} -eq 0 ]; then
files=("${root}"/bin/configs/*.yaml)
fi
diff --git a/docs/configuration.md b/docs/configuration.md
index 30d95b58f394..6a65f3f8cb1e 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -78,7 +78,7 @@ Suppose you want to apply snake case naming to mysql schema outputs. Your config
**CLI**
```
-openapi-generator -g mysql-schema -o out -i spec.yaml --additional-properties=identifierNamingConvention=snake_case
+openapi-generator -g mysql-schema -o out -i spec.yaml --additional-properties=identifierNamingConvention=snake_case,useSingleRequestParameter=true,withInterfaces=true
```
It may seem like a typo but there are two `=` signs in the above example.
diff --git a/docs/customization.md b/docs/customization.md
index 72522ee48bf4..e256c8b9b36f 100644
--- a/docs/customization.md
+++ b/docs/customization.md
@@ -318,7 +318,6 @@ CONFIG OPTIONS
...... (results omitted)
library
library template (sub-template) to use:
- jersey1 - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2
jersey2 - HTTP client: Jersey client 2.6
feign - HTTP client: Netflix Feign 8.1.1. JSON processing: Jackson 2.6.3
okhttp-gson (default) - HTTP client: OkHttp 2.4.0. JSON processing: Gson 2.3.1
@@ -413,10 +412,18 @@ One can map the property name using `nameMappings` option and parameter name usi
Here is an example to use `nameMappings` and `parameterNameMapping` in CLI:
```sh
-java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml -o /tmp/java2/ --name-mappings _type=underscoreType, type_=typeWithUnderscore, --parameter-name-mappings _type=paramType, type_=typeParam
+java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml -o /tmp/java2/ --name-mappings _type=underscoreType,type_=typeWithUnderscore, --parameter-name-mappings _type=paramType,type_=typeParam
```
-(Not all generators support this feature yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly.)
+To map model names, use `modelNameMappings` option, e.g.
+```sh
+java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g csharp -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /tmp/csharp/ --model-name-mappings Tag=Label
+```
+will rename the `Tag` schema to `Label` instead.
+
+Not all generators support thess features yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly. We also welcome PRs to add these features to generators. Related PRs for reference: #16209, #16234 (modelNameMappings), #16194, #16206 (nameMappings, parameterNameMappings).
+
+NOTE: some generators use `baseName` (original name obtained direclty from OpenAPI spec, e.g. `shipping-date`) mustache tag in the templates so the mapping feature won't work.
## Schema Mapping
diff --git a/docs/generators.md b/docs/generators.md
index a964a33934b1..d07a0bf2abb5 100644
--- a/docs/generators.md
+++ b/docs/generators.md
@@ -50,8 +50,10 @@ The following generators are available:
* [perl](generators/perl.md)
* [php](generators/php.md)
* [php-dt (beta)](generators/php-dt.md)
+* [php-nextgen (beta)](generators/php-nextgen.md)
* [powershell (beta)](generators/powershell.md)
* [python](generators/python.md)
+* [python-pydantic-v1](generators/python-pydantic-v1.md)
* [r](generators/r.md)
* [ruby](generators/ruby.md)
* [rust](generators/rust.md)
diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md
index b3962ea7d281..814ed0d4bd2f 100644
--- a/docs/generators/aspnetcore.md
+++ b/docs/generators/aspnetcore.md
@@ -197,6 +197,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
string
struct
switch
+
system
this
throw
true
diff --git a/docs/generators/csharp-functions.md b/docs/generators/csharp-functions.md
index 65570107e433..8faf39035852 100644
--- a/docs/generators/csharp-functions.md
+++ b/docs/generators/csharp-functions.md
@@ -190,6 +190,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
string
struct
switch
+
system
this
throw
true
diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md
index c3b17808dc7a..54ee3942c724 100644
--- a/docs/generators/csharp.md
+++ b/docs/generators/csharp.md
@@ -49,6 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false|
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false|
+|useSourceGeneration|Use source generation where available (only `generichost` library supports this option).| |false|
|validatable|Generates self-validatable models.| |true|
|zeroBasedEnums|Enumerations with string values will start from 0 when true, 1 when false. If not set, enumerations with string values will start from 0 if the first value is 'unknown', case insensitive.| |null|
@@ -192,6 +193,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
string
struct
switch
+
system
this
throw
true
diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md
index 7a1e04c8d61d..ef327d98124f 100644
--- a/docs/generators/groovy.md
+++ b/docs/generators/groovy.md
@@ -169,7 +169,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -187,6 +189,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md
index 850f5893ddbe..84a85a253a23 100644
--- a/docs/generators/java-camel.md
+++ b/docs/generators/java-camel.md
@@ -119,6 +119,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|x-content-type|Specify custom value for 'Content-Type' header for operation|OPERATION|null
|x-class-extra-annotation|List of custom annotations to be added to model|MODEL|null
|x-field-extra-annotation|List of custom annotations to be added to property|FIELD|null
+|x-operation-extra-annotation|List of custom annotations to be added to operation|OPERATION|null
|x-spring-paginated|Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters|OPERATION|false
|x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|OPERATION_PARAMETER|null
|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD|null
@@ -207,7 +208,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -225,6 +228,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/java-helidon-client.md b/docs/generators/java-helidon-client.md
index 0fe8a89af37f..e7c4f63d0b57 100644
--- a/docs/generators/java-helidon-client.md
+++ b/docs/generators/java-helidon-client.md
@@ -162,7 +162,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -180,6 +182,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/java-helidon-server.md b/docs/generators/java-helidon-server.md
index 59775ec0102b..a027e1cee38d 100644
--- a/docs/generators/java-helidon-server.md
+++ b/docs/generators/java-helidon-server.md
@@ -164,7 +164,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -182,6 +184,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md
index a19950231d31..c91aa73e31bd 100644
--- a/docs/generators/java-inflector.md
+++ b/docs/generators/java-inflector.md
@@ -166,7 +166,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -184,6 +186,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md
index 52af7c2cf05f..76e90328b3f7 100644
--- a/docs/generators/java-micronaut-client.md
+++ b/docs/generators/java-micronaut-client.md
@@ -194,7 +194,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -212,6 +214,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
pathvariable
private
diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md
index 54cafb5ca407..2366e962c65b 100644
--- a/docs/generators/java-micronaut-server.md
+++ b/docs/generators/java-micronaut-server.md
@@ -194,7 +194,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -212,6 +214,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
pathvariable
private
diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md
index cede0aa29f16..06ba5f7141d7 100644
--- a/docs/generators/java-msf4j.md
+++ b/docs/generators/java-msf4j.md
@@ -49,7 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null|
|invokerPackage|root package for generated code| |org.openapitools.api|
|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.
|jersey2|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|modelPackage|package for generated models| |org.openapitools.model|
@@ -172,7 +172,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -190,6 +192,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md
index ab30099f0b98..56f49ef7d2f1 100644
--- a/docs/generators/java-pkmst.md
+++ b/docs/generators/java-pkmst.md
@@ -173,7 +173,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -191,6 +193,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md
index cfb6902cc144..b0205e0a4b3a 100644
--- a/docs/generators/java-play-framework.md
+++ b/docs/generators/java-play-framework.md
@@ -176,7 +176,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -194,6 +196,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md
index 61449ed8c73c..7342fd046e8f 100644
--- a/docs/generators/java-undertow-server.md
+++ b/docs/generators/java-undertow-server.md
@@ -166,7 +166,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -184,6 +186,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md
index cf655896f0d4..2057fefafc98 100644
--- a/docs/generators/java-vertx-web.md
+++ b/docs/generators/java-vertx-web.md
@@ -166,7 +166,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -184,6 +186,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md
index c6292e24a76c..57b3b487f73d 100644
--- a/docs/generators/java-vertx.md
+++ b/docs/generators/java-vertx.md
@@ -169,7 +169,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -187,6 +189,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/java.md b/docs/generators/java.md
index 70aee6e9d7cb..79cc58568fd4 100644
--- a/docs/generators/java.md
+++ b/docs/generators/java.md
@@ -57,7 +57,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null|
|invokerPackage|root package for generated code| |org.openapitools.client|
|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|
-|library|library template (sub-template) to use|
**jersey1**
HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey3' or other HTTP libraries instead.
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
**jersey3**
HTTP client: Jersey client 3.x. JSON processing: Jackson 2.x
**feign**
HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x. or Gson 2.x
**okhttp-gson**
[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
**retrofit2**
HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
**resttemplate**
HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
**webclient**
HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
**resteasy**
HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
**vertx**
HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
**google-api-client**
HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
**rest-assured**
HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
**native**
HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
**microprofile**
HTTP client: Microprofile client 1.x. JSON processing: JSON-B or Jackson 2.9.x
**apache-httpclient**
HTTP client: Apache httpclient 5.x
|okhttp-gson|
+|library|library template (sub-template) to use|
**jersey2**
HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
**jersey3**
HTTP client: Jersey client 3.x. JSON processing: Jackson 2.x
**feign**
HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x. or Gson 2.x
**okhttp-gson**
[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
**retrofit2**
HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
**resttemplate**
HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
**webclient**
HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
**resteasy**
HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
**vertx**
HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
**google-api-client**
HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
**rest-assured**
HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
**native**
HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
**microprofile**
HTTP client: Microprofile client 1.x. JSON processing: JSON-B or Jackson 2.9.x
**apache-httpclient**
HTTP client: Apache httpclient 5.x
|okhttp-gson|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null|
@@ -85,13 +85,14 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate, webclient, libraries| |false|
|useBeanValidation|Use BeanValidation API annotations| |false|
+|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false|
|useGzipFeature|Send gzip-encoded requests| |false|
|useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false|
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped. Only jersey2, jersey3, native, okhttp-gson support this option.| |false|
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
|usePlayWS|Use Play! Async HTTP client (Play WS API)| |false|
|useReflectionEqualsHashCode|Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact.| |false|
-|useRuntimeException|Use RuntimeException instead of Exception. Only jersey, jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
+|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson support this option.| |false|
@@ -149,7 +150,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
## LANGUAGE PRIMITIVES
-
BigDecimal
Boolean
Double
Float
@@ -198,7 +198,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -216,6 +218,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md
index 7e2a6b8ecf53..3c470946b303 100644
--- a/docs/generators/jaxrs-cxf-cdi.md
+++ b/docs/generators/jaxrs-cxf-cdi.md
@@ -180,7 +180,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -198,6 +200,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md
index 15db2ea2ed98..d2501c27ed7b 100644
--- a/docs/generators/jaxrs-cxf-client.md
+++ b/docs/generators/jaxrs-cxf-client.md
@@ -171,7 +171,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -189,6 +191,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md
index 98f4bdca2f9e..b5e40fddf862 100644
--- a/docs/generators/jaxrs-cxf-extended.md
+++ b/docs/generators/jaxrs-cxf-extended.md
@@ -194,7 +194,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -212,6 +214,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md
index 96ba29d43084..19cbe9aaa0ac 100644
--- a/docs/generators/jaxrs-cxf.md
+++ b/docs/generators/jaxrs-cxf.md
@@ -189,7 +189,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -207,6 +209,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md
index 0d22772e3919..7fb90a08c427 100644
--- a/docs/generators/jaxrs-jersey.md
+++ b/docs/generators/jaxrs-jersey.md
@@ -49,7 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null|
|invokerPackage|root package for generated code| |org.openapitools.api|
|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.
|jersey2|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|modelPackage|package for generated models| |org.openapitools.model|
@@ -67,7 +67,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|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/gen/java|
-|supportJava6|Whether to support Java6 with the Jersey1/2 library.| |false|
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true|
@@ -173,7 +172,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -191,6 +192,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md
index 121e500e0bcd..f78b67963026 100644
--- a/docs/generators/jaxrs-resteasy-eap.md
+++ b/docs/generators/jaxrs-resteasy-eap.md
@@ -173,7 +173,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -191,6 +193,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md
index d1010ba5281e..55bb4e75cefb 100644
--- a/docs/generators/jaxrs-resteasy.md
+++ b/docs/generators/jaxrs-resteasy.md
@@ -172,7 +172,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -190,6 +192,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md
index 6c2215a8f664..8c5c3e899c8c 100644
--- a/docs/generators/jaxrs-spec.md
+++ b/docs/generators/jaxrs-spec.md
@@ -180,7 +180,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -198,6 +200,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md
index 72604be478ab..692e14c1d726 100644
--- a/docs/generators/kotlin-server.md
+++ b/docs/generators/kotlin-server.md
@@ -34,11 +34,11 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|interfaceOnly|Whether to generate only API interface stubs without the server files. This option is currently supported only when using jaxrs-spec library.| |false|
|library|library template (sub-template)|
**ktor**
ktor framework
**jaxrs-spec**
JAX-RS spec only
|ktor|
|modelMutable|Create mutable models| |false|
+|omitGradleWrapper|Whether to omit Gradle wrapper for creating a sub project.| |false|
|packageName|Generated artifact package name.| |org.openapitools.server|
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true. This option is currently supported only when using jaxrs-spec library.| |false|
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
-|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson' or 'kotlinx_serialization'| |moshi|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|sourceFolder|source folder for generated code| |src/main/kotlin|
diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md
index 8c818cfc0bbc..7c68491bc1f1 100644
--- a/docs/generators/kotlin-spring.md
+++ b/docs/generators/kotlin-spring.md
@@ -41,7 +41,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|reactive|use coroutines for reactive behavior| |false|
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
-|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson' or 'kotlinx_serialization'| |moshi|
|serverPort|configuration the port in which the sever is to run on| |8080|
|serviceImplementation|generate stub service implementations that extends service interfaces. If this is set to true service interfaces will also be generated| |false|
|serviceInterface|generate service interfaces to go alongside controllers. In most cases this option would be used to update an existing project, so not to override implementations. Useful to help facilitate the generation gap pattern| |false|
diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md
index daafb64eb39e..c73360d14870 100644
--- a/docs/generators/kotlin-vertx.md
+++ b/docs/generators/kotlin-vertx.md
@@ -28,7 +28,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|packageName|Generated artifact package name.| |org.openapitools|
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
-|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson' or 'kotlinx_serialization'| |moshi|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|sourceFolder|source folder for generated code| |src/main/kotlin|
diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md
index 90a022166dbb..45be9d5e2a76 100644
--- a/docs/generators/kotlin.md
+++ b/docs/generators/kotlin.md
@@ -28,7 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false|
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|idea|Add IntellJ Idea plugin and mark Kotlin main and test folders as source folders.| |false|
-|library|Library template (sub-template) to use|
Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.
|jvm-okhttp4|
|modelMutable|Create mutable models| |false|
|moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false|
|nullableReturnType|Nullable return type| |false|
diff --git a/docs/generators/php-nextgen.md b/docs/generators/php-nextgen.md
new file mode 100644
index 000000000000..606e12c8d57d
--- /dev/null
+++ b/docs/generators/php-nextgen.md
@@ -0,0 +1,269 @@
+---
+title: Documentation for the php-nextgen Generator
+---
+
+## METADATA
+
+| Property | Value | Notes |
+| -------- | ----- | ----- |
+| generator name | php-nextgen | pass this to the generate command after -g |
+| generator stability | BETA | |
+| generator type | CLIENT | |
+| generator language | PHP | |
+| generator default templating engine | mustache | |
+| helpTxt | Generates a PHP client library (beta). | |
+
+## CONFIG OPTIONS
+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|
+|artifactUrl|artifact URL in generated pom.xml| |null|
+|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null|
+|composerPackageName|The name to use in the composer package name field. e.g. `vendor/project` (must be lowercase and consist of words separated by `-`, `.` or `_`).| |null|
+|developerOrganization|developer organization in generated pom.xml| |null|
+|developerOrganizationUrl|developer organization URL in generated pom.xml| |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|
+|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false|
+|hideGenerationTimestamp|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |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|
+|licenseName|The name of the license| |null|
+|modelPackage|package for generated models| |null|
+|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
+
+
+
\DateTime
+
\SplFileObject
+
array
+
bool
+
boolean
+
byte
+
float
+
int
+
integer
+
mixed
+
number
+
object
+
string
+
void
+
+
+## RESERVED WORDS
+
+
+
__halt_compiler
+
_header_accept
+
_tempbody
+
abstract
+
and
+
array
+
as
+
break
+
callable
+
case
+
catch
+
class
+
clone
+
const
+
continue
+
declare
+
default
+
die
+
do
+
echo
+
else
+
elseif
+
empty
+
enddeclare
+
endfor
+
endforeach
+
endif
+
endswitch
+
endwhile
+
eval
+
exit
+
extends
+
final
+
for
+
foreach
+
formparams
+
function
+
global
+
goto
+
headerparams
+
httpbody
+
if
+
implements
+
include
+
include_once
+
instanceof
+
insteadof
+
interface
+
isset
+
list
+
namespace
+
new
+
or
+
print
+
private
+
protected
+
public
+
queryparams
+
require
+
require_once
+
resourcepath
+
return
+
static
+
switch
+
throw
+
trait
+
try
+
unset
+
use
+
var
+
while
+
xor
+
+
+## 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
+|Uuid|✗|
+|Array|✓|OAS2,OAS3
+|Null|✗|OAS3
+|AnyType|✗|OAS2,OAS3
+|Object|✓|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
+|allOf|✗|OAS2,OAS3
+|anyOf|✗|OAS3
+|oneOf|✗|OAS3
+|not|✗|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
+|SignatureAuth|✗|OAS3
+
+### Wire Format Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|JSON|✓|OAS2,OAS3
+|XML|✓|OAS2,OAS3
+|PROTOBUF|✗|ToolingExtension
+|Custom|✗|OAS2,OAS3
diff --git a/docs/generators/php.md b/docs/generators/php.md
index da5d62a51fdc..a1e5e677735c 100644
--- a/docs/generators/php.md
+++ b/docs/generators/php.md
@@ -31,6 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|hideGenerationTimestamp|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |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|
+|library|HTTP library template (sub-template) to use|
**guzzle**
Guzzle
**psr-18**
psr/http-client-implementation, also known as PSR-18. (beta support)
|guzzle|
|licenseName|The name of the license| |null|
|modelPackage|package for generated models| |null|
|packageName|The main package name for classes. e.g. GeneratedPetstore| |null|
diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md
index acfdd4093e4b..59d023f1e3c7 100644
--- a/docs/generators/python-aiohttp.md
+++ b/docs/generators/python-aiohttp.md
@@ -78,10 +78,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
async
auth_settings
await
+
base64
body_params
break
class
continue
+
date
def
del
elif
@@ -90,6 +92,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
exec
false
finally
+
float
for
form_params
from
@@ -99,6 +102,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
import
in
is
+
json
lambda
local_var_files
none
@@ -113,6 +117,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
raise
resource_path
return
+
schema
self
true
try
diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md
index 37d3370ec488..4f7698d343ac 100644
--- a/docs/generators/python-blueplanet.md
+++ b/docs/generators/python-blueplanet.md
@@ -78,10 +78,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
async
auth_settings
await
+
base64
body_params
break
class
continue
+
date
def
del
elif
@@ -90,6 +92,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
exec
false
finally
+
float
for
form_params
from
@@ -99,6 +102,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
import
in
is
+
json
lambda
local_var_files
none
@@ -113,6 +117,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
raise
resource_path
return
+
schema
self
true
try
diff --git a/docs/generators/python-fastapi.md b/docs/generators/python-fastapi.md
index 6cf1623d23d8..5597ee02e841 100644
--- a/docs/generators/python-fastapi.md
+++ b/docs/generators/python-fastapi.md
@@ -73,10 +73,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
async
auth_settings
await
+
base64
body_params
break
class
continue
+
date
def
del
elif
@@ -85,6 +87,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
exec
false
finally
+
float
for
form_params
from
@@ -94,6 +97,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
import
in
is
+
json
lambda
local_var_files
none
@@ -108,6 +112,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
raise
resource_path
return
+
schema
self
true
try
diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md
index 5f9062ab7ba4..9e5bd29fbc67 100644
--- a/docs/generators/python-flask.md
+++ b/docs/generators/python-flask.md
@@ -78,10 +78,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl
async
auth_settings
await
+
base64
body_params
break
class
continue
+
date
def
del
elif
@@ -90,6 +92,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
exec
false
finally
+
float
for
form_params
from
@@ -99,6 +102,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
import
in
is
+
json
lambda
local_var_files
none
@@ -113,6 +117,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
raise
resource_path
return
+
schema
self
true
try
diff --git a/docs/generators/python-pydantic-v1.md b/docs/generators/python-pydantic-v1.md
new file mode 100644
index 000000000000..e157b9b1a05d
--- /dev/null
+++ b/docs/generators/python-pydantic-v1.md
@@ -0,0 +1,232 @@
+---
+title: Documentation for the python-pydantic-v1 Generator
+---
+
+## METADATA
+
+| Property | Value | Notes |
+| -------- | ----- | ----- |
+| generator name | python-pydantic-v1 | pass this to the generate command after -g |
+| generator stability | STABLE | |
+| generator type | CLIENT | |
+| generator language | Python | |
+| generator language version | 3.7+ | |
+| generator default templating engine | mustache | |
+| helpTxt | Generates a Python client library. | |
+
+## CONFIG OPTIONS
+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 |
+| ------ | ----------- | ------ | ------- |
+|dateFormat|date format for query parameters| |%Y-%m-%d|
+|datetimeFormat|datetime format for query parameters| |%Y-%m-%dT%H:%M:%S%z|
+|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|
+|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false|
+|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
+|library|library template (sub-template) to use: asyncio, tornado (deprecated), urllib3| |urllib3|
+|mapNumberTo|Map number to Union[StrictFloat, StrictInt], StrictStr or float.| |Union[StrictFloat, StrictInt]|
+|packageName|python package name (convention: snake_case).| |openapi_client|
+|packageUrl|python package URL.| |null|
+|packageVersion|python package version.| |1.0.0|
+|projectName|python project name in setup.py (e.g. petstore-api).| |null|
+|recursionLimit|Set the recursion limit. If not set, use the system default value.| |null|
+|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false|
+
+## IMPORT MAPPING
+
+| Type/Alias | Imports |
+| ---------- | ------- |
+
+
+## INSTANTIATION TYPES
+
+| Type/Alias | Instantiated By |
+| ---------- | --------------- |
+
+
+## LANGUAGE PRIMITIVES
+
+
+
Dict
+
List
+
bool
+
bytearray
+
bytes
+
date
+
datetime
+
decimal.Decimal
+
dict
+
float
+
int
+
list
+
none_type
+
object
+
str
+
+
+## RESERVED WORDS
+
+
+
and
+
as
+
assert
+
async
+
await
+
base64
+
break
+
class
+
continue
+
date
+
def
+
del
+
elif
+
else
+
except
+
exec
+
false
+
finally
+
for
+
from
+
global
+
if
+
import
+
in
+
is
+
json
+
lambda
+
none
+
nonlocal
+
not
+
or
+
pass
+
print
+
property
+
raise
+
return
+
schema
+
self
+
true
+
try
+
while
+
with
+
yield
+
+
+## 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
+|Uuid|✗|
+|Array|✓|OAS2,OAS3
+|Null|✗|OAS3
+|AnyType|✗|OAS2,OAS3
+|Object|✓|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
+|allOf|✓|OAS2,OAS3
+|anyOf|✓|OAS3
+|oneOf|✓|OAS3
+|not|✗|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
+|SignatureAuth|✓|OAS3
+
+### Wire Format Feature
+| Name | Supported | Defined By |
+| ---- | --------- | ---------- |
+|JSON|✓|OAS2,OAS3
+|XML|✓|OAS2,OAS3
+|PROTOBUF|✗|ToolingExtension
+|Custom|✓|OAS2,OAS3
diff --git a/docs/generators/python.md b/docs/generators/python.md
index 84a01d4f3011..21eb6eb5c3f9 100644
--- a/docs/generators/python.md
+++ b/docs/generators/python.md
@@ -68,12 +68,15 @@ These options may be applied as additional-properties (cli) or configOptions (pl
## RESERVED WORDS
+
all_params
and
as
assert
async
+
auth_settings
await
base64
+
body_params
break
class
continue
@@ -86,23 +89,30 @@ These options may be applied as additional-properties (cli) or configOptions (pl
exec
false
finally
+
float
for
+
form_params
from
global
+
header_params
if
import
in
is
json
lambda
+
local_var_files
none
nonlocal
not
or
pass
+
path_params
print
property
+
query_params
raise
+
resource_path
return
schema
self
diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md
index 3b991620aa06..e837c7b97c42 100644
--- a/docs/generators/ruby.md
+++ b/docs/generators/ruby.md
@@ -33,7 +33,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|gemVersion|gem version.| |1.0.0|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |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|
-|library|HTTP library template (sub-template) to use|
|typhoeus|
|moduleName|top module name (convention: CamelCase, usually corresponding to gem name).| |OpenAPIClient|
|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|
diff --git a/docs/generators/scala-akka-http-server.md b/docs/generators/scala-akka-http-server.md
index df3cef97920e..8419c093758b 100644
--- a/docs/generators/scala-akka-http-server.md
+++ b/docs/generators/scala-akka-http-server.md
@@ -37,6 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|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| |null|
+|useApachePekko|Use apache pekko-http instead of akka-http.| |false|
## IMPORT MAPPING
diff --git a/docs/generators/spring.md b/docs/generators/spring.md
index 56213442d50c..3b5f5f5f4d0a 100644
--- a/docs/generators/spring.md
+++ b/docs/generators/spring.md
@@ -112,6 +112,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|x-content-type|Specify custom value for 'Content-Type' header for operation|OPERATION|null
|x-class-extra-annotation|List of custom annotations to be added to model|MODEL|null
|x-field-extra-annotation|List of custom annotations to be added to property|FIELD|null
+|x-operation-extra-annotation|List of custom annotations to be added to operation|OPERATION|null
|x-spring-paginated|Add org.springframework.data.domain.Pageable to controller method. Can be used to handle page & size query parameters|OPERATION|false
|x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|OPERATION_PARAMETER|null
|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD|null
@@ -200,7 +201,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
int
interface
list
+
localdate
localreturntype
+
localtime
localvaraccept
localvaraccepts
localvarauthnames
@@ -218,6 +221,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
new
null
object
+
offsetdatetime
package
private
protected
diff --git a/docs/global-properties.md b/docs/global-properties.md
index c2c0aab64788..1fe76f580136 100644
--- a/docs/global-properties.md
+++ b/docs/global-properties.md
@@ -14,9 +14,9 @@ title: Global Properties
| verbose | Defines the verbosity | `true` or `false` |
| generateAliasAsModel | Defines whether primitive types defined at the model/schema level will be wrapped in a model | `true` or `false` |
| org.openapitools.codegen.utils.oncelogger.enabled | Enable/disable the "OnceLogger" which reduces noise for select repeated logs | `true` or `false` |
-| supportingFiles | Allows the user to define which supporting files will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a comma-separated string of file names |
-| models | Allows the user to define which models will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a comma-separated string of model names |
-| apis | Allows the user to define which apis will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a comma-separated string of api names |
+| supportingFiles | Allows the user to define which supporting files will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of file names |
+| models | Allows the user to define which models will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of model names |
+| apis | Allows the user to define which apis will be generated. Prefer using the more robust `.openapi-generator-ignore`. | no value, or a colon-separated string of api names |
| apiDocs | Allows the user to define if api docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
| modelDocs | Allows the user to define if model docs will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
| apiTests | Allows the user to define if api tests will be generated. Prefer using the more robust `.openapi-generator-ignore`. | `true` or `false` |
@@ -40,4 +40,4 @@ and
java {jar} generate {opts} --global-property=models
```
-Why the two differing ways to provide the same properties? We previously accepted a `-D` tooling option which resembled Java System Property declaration. In older versions of OpenAPI Generator, the option modified the SystemProperties collection directly and was truly a "system property". This option changed during the 4.x release in an effort to make OpenAPI Generator thread-safe and isolate its configuration via thread locals. We no longer mutate System Properties. In the 4.x release and earlier, specifying the tooling `-D` option with system properties intended for other tools like swagger-parser rather than passing them as true Java System Properties would lead to unexpected behavior for the user; if our tool set the system property _after_ invoking certain code, it would seem to the user like Java System Properties weren't working!
\ No newline at end of file
+Why the two differing ways to provide the same properties? We previously accepted a `-D` tooling option which resembled Java System Property declaration. In older versions of OpenAPI Generator, the option modified the SystemProperties collection directly and was truly a "system property". This option changed during the 4.x release in an effort to make OpenAPI Generator thread-safe and isolate its configuration via thread locals. We no longer mutate System Properties. In the 4.x release and earlier, specifying the tooling `-D` option with system properties intended for other tools like swagger-parser rather than passing them as true Java System Properties would lead to unexpected behavior for the user; if our tool set the system property _after_ invoking certain code, it would seem to the user like Java System Properties weren't working!
diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml
index 2a8ef9a7cb18..04f273dad27b 100644
--- a/modules/openapi-generator-cli/pom.xml
+++ b/modules/openapi-generator-cli/pom.xml
@@ -4,7 +4,7 @@
org.openapitoolsopenapi-generator-project
- 7.0.0-SNAPSHOT
+ 7.1.0-SNAPSHOT../..
diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java
index 2871642347ad..fd379374fba5 100644
--- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java
+++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java
@@ -86,6 +86,9 @@ public class ConfigHelp extends OpenApiGeneratorCommand {
@Option(name = {"--parameter-name-mappings"}, title = "parameter name mappings", description = "displays the parameter name mappings (none)")
private Boolean parameterNameMappings;
+ @Option(name = {"--model-name-mappings"}, title = "model name mappings", description = "displays the model name mappings (none)")
+ private Boolean modelNameMappings;
+
@Option(name = {"--openapi-normalizer"}, title = "openapi normalizer rules", description = "displays the OpenAPI normalizer rules (none)")
private Boolean openapiNormalizer;
@@ -527,6 +530,18 @@ private void generatePlainTextHelp(StringBuilder sb, CodegenConfig config) {
sb.append(newline);
}
+ if (Boolean.TRUE.equals(modelNameMappings)) {
+ sb.append(newline).append("MODEL NAME MAPPING").append(newline).append(newline);
+ Map map = config.modelNameMapping()
+ .entrySet()
+ .stream()
+ .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a, b) -> {
+ throw new IllegalStateException(String.format(Locale.ROOT, "Duplicated options! %s and %s", a, b));
+ }, TreeMap::new));
+ writePlainTextFromMap(sb, map, optIndent, optNestedIndent, "model name", "Mapped to");
+ sb.append(newline);
+ }
+
if (Boolean.TRUE.equals(openapiNormalizer)) {
sb.append(newline).append("OPENAPI NORMALIZER RULES").append(newline).append(newline);
Map map = config.openapiNormalizer()
diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java
index c64e44757c4b..7d4ed09e27b1 100644
--- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java
+++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java
@@ -202,6 +202,13 @@ public class Generate extends OpenApiGeneratorCommand {
+ " You can also have multiple occurrences of this option.")
private List parameterNameMappings = new ArrayList<>();
+ @Option(
+ name = {"--model-name-mappings"},
+ title = "model name mappings",
+ description = "specifies mappings between the model name and the new name in the format of model_name=AnotherName,model_name2=OtherName2."
+ + " You can also have multiple occurrences of this option.")
+ private List modelNameMappings = new ArrayList<>();
+
@Option(
name = {"--openapi-normalizer"},
title = "OpenAPI normalizer rules",
@@ -484,6 +491,7 @@ public void execute() {
applyInlineSchemaOptionsKvpList(inlineSchemaOptions, configurator);
applyNameMappingsKvpList(nameMappings, configurator);
applyParameterNameMappingsKvpList(parameterNameMappings, configurator);
+ applyModelNameMappingsKvpList(modelNameMappings, configurator);
applyOpenAPINormalizerKvpList(openapiNormalizer, configurator);
applyTypeMappingsKvpList(typeMappings, configurator);
applyAdditionalPropertiesKvpList(additionalProperties, configurator);
diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml
index e95200ecfcba..e6d65605b7f3 100644
--- a/modules/openapi-generator-core/pom.xml
+++ b/modules/openapi-generator-core/pom.xml
@@ -6,7 +6,7 @@
openapi-generator-projectorg.openapitools
- 7.0.0-SNAPSHOT
+ 7.1.0-SNAPSHOT../..
diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java
index 4b5b41dd1bee..3aaaccf16339 100644
--- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java
+++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/GeneratorSettings.java
@@ -55,6 +55,7 @@ public final class GeneratorSettings implements Serializable {
private final Map inlineSchemaOptions;
private final Map nameMappings;
private final Map parameterNameMappings;
+ private final Map modelNameMappings;
private final Map openapiNormalizer;
private final Set languageSpecificPrimitives;
private final Map reservedWordsMappings;
@@ -285,6 +286,15 @@ public Map getParameterNameMappings() {
return parameterNameMappings;
}
+ /**
+ * Gets model name mappings between a model name and the new name.
+ *
+ * @return the model name mappings
+ */
+ public Map getModelNameMappings() {
+ return modelNameMappings;
+ }
+
/**
* Gets OpenAPI normalizer rules
*
@@ -414,6 +424,7 @@ private GeneratorSettings(Builder builder) {
inlineSchemaOptions = Collections.unmodifiableMap(builder.inlineSchemaOptions);
nameMappings = Collections.unmodifiableMap(builder.nameMappings);
parameterNameMappings = Collections.unmodifiableMap(builder.parameterNameMappings);
+ modelNameMappings = Collections.unmodifiableMap(builder.modelNameMappings);
openapiNormalizer = Collections.unmodifiableMap(builder.openapiNormalizer);
languageSpecificPrimitives = Collections.unmodifiableSet(builder.languageSpecificPrimitives);
reservedWordsMappings = Collections.unmodifiableMap(builder.reservedWordsMappings);
@@ -490,6 +501,7 @@ public GeneratorSettings() {
inlineSchemaOptions = Collections.unmodifiableMap(new HashMap<>(0));
nameMappings = Collections.unmodifiableMap(new HashMap<>(0));
parameterNameMappings = Collections.unmodifiableMap(new HashMap<>(0));
+ modelNameMappings = Collections.unmodifiableMap(new HashMap<>(0));
openapiNormalizer = Collections.unmodifiableMap(new HashMap<>(0));
languageSpecificPrimitives = Collections.unmodifiableSet(new HashSet<>(0));
reservedWordsMappings = Collections.unmodifiableMap(new HashMap<>(0));
@@ -557,6 +569,9 @@ public static Builder newBuilder(GeneratorSettings copy) {
if (copy.getParameterNameMappings() != null) {
builder.parameterNameMappings.putAll(copy.getParameterNameMappings());
}
+ if (copy.getModelNameMappings() != null) {
+ builder.modelNameMappings.putAll(copy.getModelNameMappings());
+ }
if (copy.getOpenAPINormalizer() != null) {
builder.openapiNormalizer.putAll(copy.getOpenAPINormalizer());
}
@@ -604,6 +619,7 @@ public static final class Builder {
private Map inlineSchemaOptions;
private Map nameMappings;
private Map parameterNameMappings;
+ private Map modelNameMappings;
private Map openapiNormalizer;
private Set languageSpecificPrimitives;
private Map reservedWordsMappings;
@@ -627,6 +643,7 @@ public Builder() {
inlineSchemaOptions = new HashMap<>();
nameMappings = new HashMap<>();
parameterNameMappings = new HashMap<>();
+ modelNameMappings = new HashMap<>();
openapiNormalizer = new HashMap<>();
languageSpecificPrimitives = new HashSet<>();
reservedWordsMappings = new HashMap<>();
@@ -1000,6 +1017,32 @@ public Builder withParameterNameMapping(String key, String value) {
return this;
}
+ /**
+ * Sets the {@code modelNameMappings} and returns a reference to this Builder so that the methods can be chained together.
+ *
+ * @param modelNameMappings the {@code modelNameMappings} to set
+ * @return a reference to this Builder
+ */
+ public Builder withModelNameMappings(Map modelNameMappings) {
+ this.modelNameMappings = modelNameMappings;
+ return this;
+ }
+
+ /**
+ * Sets a single {@code modelNameMappings} and returns a reference to this Builder so that the methods can be chained together.
+ *
+ * @param key A key for the name mapping
+ * @param value The value of name mapping
+ * @return a reference to this Builder
+ */
+ public Builder withModelNameMapping(String key, String value) {
+ if (this.modelNameMappings == null) {
+ this.modelNameMappings = new HashMap<>();
+ }
+ this.modelNameMappings.put(key, value);
+ return this;
+ }
+
/**
* Sets the {@code openapiNormalizer} and returns a reference to this Builder so that the methods can be chained together.
*
@@ -1216,6 +1259,7 @@ public boolean equals(Object o) {
Objects.equals(getInlineSchemaOptions(), that.getInlineSchemaOptions()) &&
Objects.equals(getNameMappings(), that.getNameMappings()) &&
Objects.equals(getParameterNameMappings(), that.getParameterNameMappings()) &&
+ Objects.equals(getModelNameMappings(), that.getModelNameMappings()) &&
Objects.equals(getOpenAPINormalizer(), that.getOpenAPINormalizer()) &&
Objects.equals(getLanguageSpecificPrimitives(), that.getLanguageSpecificPrimitives()) &&
Objects.equals(getReservedWordsMappings(), that.getReservedWordsMappings()) &&
@@ -1250,6 +1294,7 @@ public int hashCode() {
getInlineSchemaOptions(),
getNameMappings(),
getParameterNameMappings(),
+ getModelNameMappings(),
getOpenAPINormalizer(),
getLanguageSpecificPrimitives(),
getReservedWordsMappings(),
diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java
index 020dad9e5079..e9d9824673c7 100644
--- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java
+++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java
@@ -562,8 +562,7 @@ public Builder withGlobalProperty(String key, String value) {
*/
public WorkflowSettings build() {
WorkflowSettings instance = new WorkflowSettings(this);
- //noinspection PlaceholderCountMatchesArgumentCount
- LOGGER.debug("WorkflowSettings#build: %s", instance.toString());
+ LOGGER.debug("WorkflowSettings#build: {}", instance);
return instance;
}
}
diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc
index 6088f97b7b6b..3b75426d3615 100644
--- a/modules/openapi-generator-gradle-plugin/README.adoc
+++ b/modules/openapi-generator-gradle-plugin/README.adoc
@@ -239,6 +239,21 @@ apply plugin: 'org.openapi.generator'
|None
|specifies mappings between the schema and the new name in the format of schema_a=Cat,schema_b=Bird. https://openapi-generator.tech/docs/customization/#schema-mapping
+|nameMappings
+|Map(String,String)
+|None
+|specifies mappings between the property name and the new name in the format of property_a=firstProperty,property_b=secondProperty. https://openapi-generator.tech/docs/customization/#name-mapping
+
+|modelNameMappings
+|Map(String,String)
+|None
+|specifies mappings between the model name and the new name in the format of model_a=FirstModel,property_b=SecondModel. https://openapi-generator.tech/docs/customization/#name-mapping
+
+|parameterNameMappings
+|Map(String,String)
+|None
+|specifies mappings between the parameter name and the new name in the format of parameter_a=firstParameter,parameter_b=secondParameter. https://openapi-generator.tech/docs/customization/#name-mapping
+
|inlineSchemaNameMappings
|Map(String,String)
|None
diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties
index e23e9326e336..11df589b84bc 100644
--- a/modules/openapi-generator-gradle-plugin/gradle.properties
+++ b/modules/openapi-generator-gradle-plugin/gradle.properties
@@ -1,5 +1,5 @@
# RELEASE_VERSION
-openApiGeneratorVersion=7.0.0-SNAPSHOT
+openApiGeneratorVersion=7.1.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 188c7bae52a1..eb972aa08701 100644
--- a/modules/openapi-generator-gradle-plugin/pom.xml
+++ b/modules/openapi-generator-gradle-plugin/pom.xml
@@ -4,7 +4,7 @@
org.openapitoolsopenapi-generator-project
- 7.0.0-SNAPSHOT
+ 7.1.0-SNAPSHOT../..
diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
index 95e57df31d8e..b6bc0004a3eb 100644
--- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
+++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties
@@ -1,3 +1,3 @@
# RELEASE_VERSION
-openApiGeneratorVersion=7.0.0-SNAPSHOT
+openApiGeneratorVersion=7.1.0-SNAPSHOT
# /RELEASE_VERSION
diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt
index 41da31505fb1..3947d3806ee4 100644
--- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt
+++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt
@@ -119,6 +119,9 @@ class OpenApiGeneratorPlugin : Plugin {
schemaMappings.set(generate.schemaMappings)
inlineSchemaNameMappings.set(generate.inlineSchemaNameMappings)
inlineSchemaOptions.set(generate.inlineSchemaOptions)
+ nameMappings.set(generate.nameMappings)
+ modelNameMappings.set(generate.modelNameMappings)
+ parameterNameMappings.set(generate.parameterNameMappings)
openapiNormalizer.set(generate.openapiNormalizer)
invokerPackage.set(generate.invokerPackage)
groupId.set(generate.groupId)
diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt
index 76c89b263e14..04e654942b6d 100644
--- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt
+++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt
@@ -177,6 +177,11 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
*/
val parameterNameMappings = project.objects.mapProperty()
+ /**
+ * Specifies mappings between a model name and the new name
+ */
+ val modelNameMappings = project.objects.mapProperty()
+
/**
* Specifies mappings (rules) in OpenAPI normalizer
*/
diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorValidateExtension.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorValidateExtension.kt
index 395481456b33..fb72552ee6e5 100644
--- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorValidateExtension.kt
+++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorValidateExtension.kt
@@ -33,12 +33,5 @@ open class OpenApiGeneratorValidateExtension(project: Project) {
/**
* Whether to offer recommendations related to the validated specification document.
*/
- val recommend = project.objects.property()
-
- init {
- applyDefaults()
- }
-
- @Suppress("MemberVisibilityCanBePrivate")
- fun applyDefaults() = recommend.set(true)
+ val recommend = project.objects.property().convention(true)
}
\ No newline at end of file
diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt
index a4fa91b375f6..3eeb5955a74b 100644
--- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt
+++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt
@@ -107,7 +107,7 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
* Local root folder with spec files
*/
@Optional
- @get:InputFile
+ @get:InputDirectory
@PathSensitive(PathSensitivity.RELATIVE)
val inputSpecRootDirectory = project.objects.property();
@@ -286,6 +286,13 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
@Input
val parameterNameMappings = project.objects.mapProperty()
+ /**
+ * Specifies mappings between the model name and the new name
+ */
+ @Optional
+ @Input
+ val modelNameMappings = project.objects.mapProperty()
+
/**
* Specifies mappings (rules) in OpenAPI normalizer
*/
@@ -578,10 +585,22 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
@Suppress("unused")
@TaskAction
fun doWork() {
- inputSpecRootDirectory.ifNotEmpty { inputSpecRootDirectoryValue -> {
- inputSpec.set(MergedSpecBuilder(inputSpecRootDirectoryValue, mergedFileName.get()).buildMergedSpec())
- logger.info("Merge input spec would be used - {}", inputSpec.get())
- }}
+ var resolvedInputSpec = ""
+
+ inputSpec.ifNotEmpty { value ->
+ resolvedInputSpec = value
+ }
+
+ remoteInputSpec.ifNotEmpty { value ->
+ resolvedInputSpec = value
+ }
+
+ inputSpecRootDirectory.ifNotEmpty { inputSpecRootDirectoryValue ->
+ run {
+ resolvedInputSpec = MergedSpecBuilder(inputSpecRootDirectoryValue, mergedFileName.getOrElse("merged")).buildMergedSpec()
+ logger.info("Merge input spec would be used - {}", resolvedInputSpec)
+ }
+ }
cleanupOutput.ifNotEmpty { cleanup ->
if (cleanup) {
@@ -648,6 +667,8 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
logger.warn("Both inputSpec and remoteInputSpec is specified. The remoteInputSpec will take priority over inputSpec.")
}
+ configurator.setInputSpec(resolvedInputSpec)
+
// now override with any specified parameters
verbose.ifNotEmpty { value ->
configurator.setVerbose(value)
@@ -661,14 +682,6 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
configurator.setSkipOverwrite(value ?: false)
}
- inputSpec.ifNotEmpty { value ->
- configurator.setInputSpec(value)
- }
-
- remoteInputSpec.ifNotEmpty { value ->
- configurator.setInputSpec(value)
- }
-
generatorName.ifNotEmpty { value ->
configurator.setGeneratorName(value)
}
@@ -833,6 +846,12 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
}
}
+ if (modelNameMappings.isPresent) {
+ modelNameMappings.get().forEach { entry ->
+ configurator.addModelNameMapping(entry.key, entry.value)
+ }
+ }
+
if (openapiNormalizer.isPresent) {
openapiNormalizer.get().forEach { entry ->
configurator.addOpenAPINormalizer(entry.key, entry.value)
diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/ValidateTask.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/ValidateTask.kt
index da442383e0eb..f379e6c45d21 100644
--- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/ValidateTask.kt
+++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/ValidateTask.kt
@@ -58,7 +58,7 @@ open class ValidateTask : DefaultTask() {
@Optional
@Input
- val recommend = project.objects.property()
+ val recommend = project.objects.property().convention(true)
@get:Internal
@set:Option(option = "input", description = "The input specification.")
diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskDslTest.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskDslTest.kt
index a4f288d34a64..30a725f70e08 100644
--- a/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskDslTest.kt
+++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/GenerateTaskDslTest.kt
@@ -4,7 +4,9 @@ import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.TaskOutcome
import org.testng.annotations.Test
import java.io.File
+import java.nio.file.Files.createDirectory
import java.nio.file.Files.createTempDirectory
+import java.nio.file.Paths
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
@@ -88,6 +90,75 @@ class GenerateTaskDslTest : TestBase() {
)
}
+ @Test
+ fun `openApiGenerate should create an expected file structure from root directory config`() {
+ val projectFiles = mapOf(
+ "spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0.yaml"),
+ "spec-2.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.1.yaml")
+ )
+
+ // Arrange
+ val buildContents = """
+ plugins {
+ id 'org.openapi.generator'
+ }
+ openApiGenerate {
+ generatorName = "kotlin"
+ inputSpecRootDirectory = file("specs").absolutePath
+ outputDir = file("build/kotlin").absolutePath
+ apiPackage = "org.openapitools.example.api"
+ invokerPackage = "org.openapitools.example.invoker"
+ modelPackage = "org.openapitools.example.model"
+ configOptions = [
+ dateLibrary: "java8"
+ ]
+ }
+ """.trimIndent()
+ val tempContractDirectory: File = createDirectory(Paths.get("${temp.path}/specs")).toFile()
+
+ File(temp, "build.gradle").writeText(buildContents)
+ projectFiles.forEach { entry ->
+ val target = File(tempContractDirectory, entry.key)
+ entry.value?.copyTo(target.outputStream())
+ }
+
+ // Act
+ val result = GradleRunner.create()
+ .withProjectDir(temp)
+ .withArguments("openApiGenerate", "--stacktrace")
+ .withPluginClasspath()
+ .build()
+
+ // Assert
+ assertTrue(
+ result.output.contains("Successfully generated code to"),
+ "User friendly generate notice is missing."
+ )
+
+ listOf(
+ "build/kotlin/.openapi-generator-ignore",
+ "build/kotlin/docs/PetsApi.md",
+ "build/kotlin/docs/Error.md",
+ "build/kotlin/docs/Pet.md",
+ "build/kotlin/README.md",
+ "build/kotlin/build.gradle",
+ "build/kotlin/.openapi-generator/VERSION",
+ "build/kotlin/settings.gradle",
+ "build/kotlin/src/main/kotlin/org/openapitools/example/model/Pet.kt",
+ "build/kotlin/src/main/kotlin/org/openapitools/example/model/Error.kt",
+ "build/kotlin/src/main/kotlin/org/openapitools/example/api/PetsApi.kt",
+ "build/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt"
+ ).map {
+ val f = File(temp, it)
+ assertTrue(f.exists() && f.isFile, "An expected file was not generated when invoking the generation: $f")
+ }
+
+ assertEquals(
+ TaskOutcome.SUCCESS, result.task(":openApiGenerate")?.outcome,
+ "Expected a successful run, but found ${result.task(":openApiGenerate")?.outcome}"
+ )
+ }
+
@Test
fun `openApiGenerate should create an expected file structure from DSL config`() {
// Arrange
diff --git a/modules/openapi-generator-gradle-plugin/src/test/kotlin/ValidateTaskDslTest.kt b/modules/openapi-generator-gradle-plugin/src/test/kotlin/ValidateTaskDslTest.kt
index ac457cda6431..ff05a5784ca1 100644
--- a/modules/openapi-generator-gradle-plugin/src/test/kotlin/ValidateTaskDslTest.kt
+++ b/modules/openapi-generator-gradle-plugin/src/test/kotlin/ValidateTaskDslTest.kt
@@ -144,4 +144,161 @@ class ValidateTaskDslTest : TestBase() {
"Expected a failed run, but found ${result.task(":openApiValidate")?.outcome}"
)
}
+
+ @Test(dataProvider = "gradle_version_provider")
+ fun `validateGoodSpec as defined task should succeed on valid spec`(gradleVersion: String?) {
+ // Arrange
+ val projectFiles = mapOf(
+ "spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0.yaml")
+ )
+
+ withProject(
+ """
+ | plugins {
+ | id 'org.openapi.generator'
+ | }
+ |
+ | task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.ValidateTask) {
+ | inputSpec.set(file("spec.yaml").absolutePath)
+ | }
+ """.trimMargin(), projectFiles
+ )
+
+ // Act
+ val result = getGradleRunner(gradleVersion)
+ .withProjectDir(temp)
+ .withArguments("validateGoodSpec")
+ .withPluginClasspath()
+ .build()
+
+ // Assert
+ assertTrue(
+ result.output.contains("Spec is valid."),
+ "Unexpected/no message presented to the user for a valid spec."
+ )
+ assertEquals(
+ SUCCESS, result.task(":validateGoodSpec")?.outcome,
+ "Expected a successful run, but found ${result.task(":validateGoodSpec")?.outcome}"
+ )
+ }
+
+ @Test(dataProvider = "gradle_version_provider")
+ fun `validateBadSpec as defined task should fail on invalid spec`(gradleVersion: String?) {
+ // Arrange
+ val projectFiles = mapOf(
+ "spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-invalid.yaml")
+ )
+ withProject(
+ """
+ | plugins {
+ | id 'org.openapi.generator'
+ | }
+ |
+ | task validateBadSpec(type: org.openapitools.generator.gradle.plugin.tasks.ValidateTask) {
+ | inputSpec.set(file("spec.yaml").absolutePath)
+ | }
+ """.trimMargin(), projectFiles
+ )
+
+ // Act
+ val result = getGradleRunner(gradleVersion)
+ .withProjectDir(temp)
+ .withArguments("validateBadSpec")
+ .withPluginClasspath()
+ .buildAndFail()
+
+ // Assert
+ assertTrue(
+ result.output.contains("Spec is invalid."),
+ "Unexpected/no message presented to the user for an invalid spec."
+ )
+ assertEquals(
+ FAILED, result.task(":validateBadSpec")?.outcome,
+ "Expected a failed run, but found ${result.task(":validateBadSpec")?.outcome}"
+ )
+ }
+
+ @Test(dataProvider = "gradle_version_provider")
+ fun `openApiValidate should succeed with recommendations on valid spec`(gradleVersion: String?) {
+ // Arrange
+ val projectFiles = mapOf(
+ "spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-recommend.yaml")
+ )
+
+ // recommend = true is the default
+ withProject(
+ """
+ | plugins {
+ | id 'org.openapi.generator'
+ | }
+ |
+ | openApiValidate {
+ | inputSpec = file("spec.yaml").absolutePath
+ | }
+ """.trimMargin(), projectFiles
+ )
+
+ // Act
+ val result = getGradleRunner(gradleVersion)
+ .withProjectDir(temp)
+ .withArguments("openApiValidate")
+ .withPluginClasspath()
+ .build()
+
+ // Assert
+ assertTrue(
+ result.output.contains("Spec is valid."),
+ "Unexpected/no message presented to the user for a valid spec."
+ )
+ assertTrue(
+ result.output.contains("Spec has issues or recommendations."),
+ "Unexpected/no recommendations message presented to the user for a valid spec."
+ )
+ assertEquals(
+ SUCCESS, result.task(":openApiValidate")?.outcome,
+ "Expected a successful run, but found ${result.task(":openApiValidate")?.outcome}"
+ )
+ }
+
+ @Test(dataProvider = "gradle_version_provider")
+ fun `openApiValidate should succeed without recommendations on valid spec`(gradleVersion: String?) {
+ // Arrange
+ val projectFiles = mapOf(
+ "spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0-recommend.yaml")
+ )
+
+ withProject(
+ """
+ | plugins {
+ | id 'org.openapi.generator'
+ | }
+ |
+ | openApiValidate {
+ | inputSpec = file("spec.yaml").absolutePath
+ | recommend = false
+ | }
+ """.trimMargin(), projectFiles
+ )
+
+ // Act
+ val result = getGradleRunner(gradleVersion)
+ .withProjectDir(temp)
+ .withArguments("openApiValidate")
+ .withPluginClasspath()
+ .build()
+
+ // Assert
+ assertTrue(
+ result.output.contains("Spec is valid."),
+ "Unexpected/no message presented to the user for a valid spec."
+ )
+ assertTrue(
+ result.output.contains("Spec has issues or recommendations.").not(),
+ "Unexpected/recommendations message presented to the user for a valid spec"
+ )
+ assertEquals(
+ SUCCESS, result.task(":openApiValidate")?.outcome,
+ "Expected a successful run, but found ${result.task(":openApiValidate")?.outcome}"
+ )
+ }
}
diff --git a/modules/openapi-generator-gradle-plugin/src/test/resources/specs/petstore-v3.0-recommend.yaml b/modules/openapi-generator-gradle-plugin/src/test/resources/specs/petstore-v3.0-recommend.yaml
new file mode 100644
index 000000000000..2319a08b2597
--- /dev/null
+++ b/modules/openapi-generator-gradle-plugin/src/test/resources/specs/petstore-v3.0-recommend.yaml
@@ -0,0 +1,114 @@
+openapi: "3.0.0"
+info:
+ version: 1.0.0
+ title: Swagger Petstore
+ license:
+ name: MIT
+servers:
+ - url: http://petstore.swagger.io/v1
+paths:
+ /pets:
+ get:
+ summary: List all pets
+ operationId: listPets
+ tags:
+ - pets
+ parameters:
+ - name: limit
+ in: query
+ description: How many items to return at one time (max 100)
+ required: false
+ schema:
+ type: integer
+ format: int32
+ requestBody: # warning `API GET/HEAD defined with request body`
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Pets"
+ responses:
+ '200':
+ description: A paged array of pets
+ headers:
+ x-next:
+ description: A link to the next page of responses
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Pets"
+ default:
+ description: unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ post:
+ summary: Create a pet
+ operationId: createPets
+ tags:
+ - pets
+ responses:
+ '201':
+ description: Null response
+ default:
+ description: unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ /pets/{petId}:
+ get:
+ summary: Info for a specific pet
+ operationId: showPetById
+ tags:
+ - pets
+ parameters:
+ - name: petId
+ in: path
+ required: true
+ description: The id of the pet to retrieve
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Expected response to a valid request
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Pets"
+ default:
+ description: unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+components:
+ schemas:
+ Pet:
+ required:
+ - id
+ - name
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ tag:
+ type: string
+ Pets:
+ type: array
+ items:
+ $ref: "#/components/schemas/Pet"
+ Error:
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
diff --git a/modules/openapi-generator-gradle-plugin/src/test/resources/specs/petstore-v3.1.yaml b/modules/openapi-generator-gradle-plugin/src/test/resources/specs/petstore-v3.1.yaml
new file mode 100644
index 000000000000..0a8d3d15973c
--- /dev/null
+++ b/modules/openapi-generator-gradle-plugin/src/test/resources/specs/petstore-v3.1.yaml
@@ -0,0 +1,109 @@
+openapi: "3.0.0"
+info:
+ version: 1.0.0
+ title: Swagger Petstore
+ license:
+ name: MIT
+servers:
+ - url: http://petstore.swagger.io/v1
+paths:
+ /v3/pets:
+ get:
+ summary: List all pets
+ operationId: listPets
+ tags:
+ - pets
+ parameters:
+ - name: limit
+ in: query
+ description: How many items to return at one time (max 100)
+ required: false
+ schema:
+ type: integer
+ format: int32
+ responses:
+ '200':
+ description: A paged array of pets
+ headers:
+ x-next:
+ description: A link to the next page of responses
+ schema:
+ type: string
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Pets"
+ default:
+ description: unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ post:
+ summary: Create a pet
+ operationId: createPets
+ tags:
+ - pets
+ responses:
+ '201':
+ description: Null response
+ default:
+ description: unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ /v3/pets/{petId}:
+ get:
+ summary: Info for a specific pet
+ operationId: showPetById
+ tags:
+ - pets
+ parameters:
+ - name: petId
+ in: path
+ required: true
+ description: The id of the pet to retrieve
+ schema:
+ type: string
+ responses:
+ '200':
+ description: Expected response to a valid request
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Pets"
+ default:
+ description: unexpected error
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+components:
+ schemas:
+ Pet:
+ required:
+ - id
+ - name
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ tag:
+ type: string
+ Pets:
+ type: array
+ items:
+ $ref: "#/components/schemas/Pet"
+ Error:
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md
index 02341e78ee40..15b47ba991fa 100644
--- a/modules/openapi-generator-maven-plugin/README.md
+++ b/modules/openapi-generator-maven-plugin/README.md
@@ -86,6 +86,9 @@ mvn clean compile
| `importMappings` | `openapi.generator.maven.plugin.importMappings` | specifies mappings between a given class and the import that should be used for that class in the format of type=import,type=import. You can also have multiple occurrences of this option
| `typeMappings` | `openapi.generator.maven.plugin.typeMappings` | sets mappings between OpenAPI spec types and generated code types in the format of OpenAPIType=generatedType,OpenAPIType=generatedType. For example: `array=List,map=Map,string=String`. You can also have multiple occurrences of this option. To map a specified format, use type+format, e.g. string+password=EncryptedString will map `type: string, format: password` to `EncryptedString`.
| `schemaMappings` | `openapi.generator.maven.plugin.schemaMappings` | specifies mappings between the schema and the new name in the format of schema_a=Cat,schema_b=Bird. https://openapi-generator.tech/docs/customization/#schema-mapping
+| `nameMappings` | `openapi.generator.maven.plugin.nameMappings` | specifies mappings between the property name and the new name in the format of property_a=firstProperty,property_b=secondProperty. https://openapi-generator.tech/docs/customization/#name-mapping
+| `modelNameMappings` | `openapi.generator.maven.plugin.modelNameMappings` | specifies mappings between the model name and the new name in the format of model_a=FirstModel,model_b=SecondModel. https://openapi-generator.tech/docs/customization/#name-mapping
+| `parameterNameMappings` | `openapi.generator.maven.plugin.parameterNameMappings` | specifies mappings between the parameter name and the new name in the format of param_a=first_parameter,param_b=second_parameter. https://openapi-generator.tech/docs/customization/#name-mapping
| `inlineSchemaNameMappings` | `openapi.generator.maven.plugin.inlineSchemaNameMappings` | specifies mappings between the inline schema name and the new name in the format of inline_object_2=Cat,inline_object_5=Bird.
| `inlineSchemaOptions` | `openapi.generator.maven.plugin.inlineSchemaOptions` | specifies the options used when naming inline schema in inline model resolver
| `languageSpecificPrimitives` | `openapi.generator.maven.plugin.languageSpecificPrimitives` | specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: `String,boolean,Boolean,Double`. You can also have multiple occurrences of this option
diff --git a/modules/openapi-generator-maven-plugin/examples/camel.xml b/modules/openapi-generator-maven-plugin/examples/camel.xml
index 6db57a04d322..4e3d945c5138 100644
--- a/modules/openapi-generator-maven-plugin/examples/camel.xml
+++ b/modules/openapi-generator-maven-plugin/examples/camel.xml
@@ -137,12 +137,12 @@
com.fasterxml.jackson.datatypejackson-datatype-jsr310
- 2.13.0
+ 2.15.2com.fasterxml.jackson.datatypejackson-datatype-jdk8
- 2.13.0
+ 2.15.2org.apache.camel
diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml
index 199a55e42329..96bcc4607cd4 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.openapitoolsopenapi-generator-maven-plugin
- 7.0.0-SNAPSHOT
+ 7.1.0-SNAPSHOT
@@ -94,7 +94,7 @@
- io.swagger
+ io.swagger.core.v3swagger-annotations${swagger-annotations-version}
@@ -191,13 +191,13 @@
UTF-8
- 1.6.3
+ 2.2.162.35
- 2.13.0
- 2.13.0
- 0.2.1
+ 2.15.2
+ 2.15.2
+ 0.2.61.3.54.13.2
- 8.3.1
+ 8.3.3
diff --git a/modules/openapi-generator-maven-plugin/examples/kotlin.xml b/modules/openapi-generator-maven-plugin/examples/kotlin.xml
index 3a45b3beadaa..21ce29311af0 100644
--- a/modules/openapi-generator-maven-plugin/examples/kotlin.xml
+++ b/modules/openapi-generator-maven-plugin/examples/kotlin.xml
@@ -15,7 +15,7 @@
org.openapitoolsopenapi-generator-maven-plugin
- 7.0.0-SNAPSHOT
+ 7.1.0-SNAPSHOT
@@ -232,7 +232,7 @@
1.5.82.27
- 2.9.10
+ 2.15.20.2.02.71.0.0
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 d8980404f5e7..6c40c71be00c 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.openapitoolsopenapi-generator-maven-plugin
- 7.0.0-SNAPSHOT
+ 7.1.0-SNAPSHOT
@@ -147,7 +147,7 @@
com.github.scribejavascribejava-apis
- 8.3.1
+ 8.3.3org.tomitribe
diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml
index cbb7fa713c5e..fdc0d5272e05 100644
--- a/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml
+++ b/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml
@@ -15,7 +15,7 @@
1.5.82.35
- 2.13.0
+ 2.15.20.2.12.71.0.0
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 ecaf68395206..acdfe54dfdd5 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.openapitoolsopenapi-generator-maven-plugin
- 7.0.0-SNAPSHOT
+ 7.1.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 f1362aca0e42..7d3617d18d13 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.openapitoolsopenapi-generator-maven-plugin
- 7.0.0-SNAPSHOT
+ 7.1.0-SNAPSHOT
diff --git a/modules/openapi-generator-maven-plugin/examples/spring.xml b/modules/openapi-generator-maven-plugin/examples/spring.xml
index 9c8ce79399a0..02d44313e189 100644
--- a/modules/openapi-generator-maven-plugin/examples/spring.xml
+++ b/modules/openapi-generator-maven-plugin/examples/spring.xml
@@ -1,130 +1,135 @@
- 4.0.0
- org.openapitools
- sample-project
- jar
- 1.0-SNAPSHOT
- sample-project
- https://maven.apache.org
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ 4.0.0
+ org.openapitools
+ sample-project
+ jar
+ 1.0-SNAPSHOT
+ sample-project
+ https://maven.apache.org
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.7.6
-
-
-
-
-
- org.openapitools
- openapi-generator-maven-plugin
-
- 7.0.0-SNAPSHOT
-
-
-
- spring-server
-
- generate
-
-
-
- ${project.basedir}/swagger.yaml
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.7.15
+
+
+
+
+
+ org.openapitools
+ openapi-generator-maven-plugin
+
+ 7.1.0-SNAPSHOT
+
+
+
+ spring-server
+
+ generate
+
+
+
+ ${project.basedir}/swagger.yaml
-
- spring
+
+ spring
-
+
-
-
- springfox
- true
- true
-
+
+
+ springfox
+ true
+ true
+
-
-
+
+
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.1
-
- 1.8
- 1.8
- none
-
-
-
-
-
-
-
-
- sonatype-snapshots
- https://oss.sonatype.org/content/repositories/snapshots/
-
-
-
-
-
-
- io.swagger
- swagger-annotations
- ${swagger-annotations-version}
-
-
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.springframework.data
- spring-data-commons
-
-
-
- io.springfox
- springfox-swagger2
- ${springfox-version}
-
-
- io.springfox
- springfox-swagger-ui
- ${springfox-version}
-
-
- javax.xml.bind
- jaxb-api
- 2.2.11
-
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jsr310
-
-
- org.openapitools
- jackson-databind-nullable
- 0.1.0
-
-
-
- javax.validation
- validation-api
-
-
-
-
- 1.5.8
- 2.8.0
-
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.11.0
+
+ 1.8
+ 1.8
+ none
+
+
+
+
+
+
+
+
+ sonatype-snapshots
+ https://oss.sonatype.org/content/repositories/snapshots/
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.data
+ spring-data-commons
+
+
+
+ io.springfox
+ springfox-swagger2
+ ${springfox.version}
+
+
+ org.webjars
+ swagger-ui
+ ${swagger-ui.version}
+
+
+ org.webjars
+ webjars-locator-core
+
+
+
+ com.google.code.findbugs
+ jsr305
+ 3.0.2
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+
+
+ org.openapitools
+ jackson-databind-nullable
+ 0.2.6
+
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+ 2.9.2
+ 4.15.5
+
diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml
index 63976049c47e..c8598352669d 100644
--- a/modules/openapi-generator-maven-plugin/pom.xml
+++ b/modules/openapi-generator-maven-plugin/pom.xml
@@ -5,7 +5,7 @@
org.openapitoolsopenapi-generator-project
- 7.0.0-SNAPSHOT
+ 7.1.0-SNAPSHOT../..
@@ -27,28 +27,31 @@
org.apache.mavenmaven-core
- 3.8.6
+ 3.9.4
+ providedorg.apache.mavenmaven-artifact
- 3.8.6
+ 3.9.4providedorg.apache.mavenmaven-compat
- 3.8.6
+ 3.9.4
+ testorg.apache.mavenmaven-plugin-api
- 3.8.6
+ 3.9.4
+ providedorg.apache.maven.plugin-toolsmaven-plugin-annotations
- 3.6.4
+ 3.9.0org.openapitools
@@ -72,13 +75,28 @@
maven-plugin-testing-harness3.3.0test
+
+
+
+ org.codehaus.plexus
+ plexus-archiver
+
+ org.codehaus.plexusplexus-utils
- 3.5.0
+ 3.5.1
+ test
+
+
+
+ org.codehaus.plexus
+ plexus-archiver
+ 4.8.0test
+
@@ -86,7 +104,7 @@
org.apache.maven.pluginsmaven-plugin-plugin
- 3.6.4
+ 3.9.0true
@@ -144,7 +162,7 @@
org.apache.maven.pluginsmaven-invoker-plugin
- 3.2.2
+ 3.6.0falsetrue
diff --git a/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey3/invoker.properties b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey3/invoker.properties
new file mode 100644
index 000000000000..7ca0a57da2ad
--- /dev/null
+++ b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey3/invoker.properties
@@ -0,0 +1,3 @@
+invoker.goals = -nsu clean generate-sources
+# The expected result of the build, possible values are "success" (default) and "failure"
+invoker.buildResult = success
diff --git a/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey3/pom.xml b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey3/pom.xml
new file mode 100644
index 000000000000..35ba8150e868
--- /dev/null
+++ b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey3/pom.xml
@@ -0,0 +1,67 @@
+
+
+
+
+ 4.0.0
+
+ org.openapitools.maven.its
+ jaxrs-jersey3
+ 1.0-SNAPSHOT
+
+
+ true
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.10.0
+
+ 11
+ 11
+
+
+
+ @project.groupId@
+ @project.artifactId@
+ @project.version@
+
+ https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+ jaxrs-jersey
+ jersey3
+ java8
+
+ ${project.basedir}/templates
+
+
+
+
+
+ remote
+ generate-sources
+
+ generate
+
+
+
+
+
+
+
diff --git a/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey3/templates/README.mustache b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey3/templates/README.mustache
new file mode 100644
index 000000000000..cee4f752e72a
--- /dev/null
+++ b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey3/templates/README.mustache
@@ -0,0 +1,21 @@
+# TEST TEST TEST
+
+# {{artifactId}}
+
+{{appName}}
+
+- API version: {{appVersion}}
+{{^hideGenerationTimestamp}}
+
+- Build date: {{generatedDate}}
+{{/hideGenerationTimestamp}}
+
+{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}}
+
+{{#infoUrl}}
+ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
+{{/infoUrl}}
+
+*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
+
+… etc.
diff --git a/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey3/verify.groovy b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey3/verify.groovy
new file mode 100644
index 000000000000..40ba52de40de
--- /dev/null
+++ b/modules/openapi-generator-maven-plugin/src/it/jaxrs-jersey3/verify.groovy
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+File readme = new File(basedir, "out/README.md")
+
+assert readme.isFile()
+assert readme.text.contains("# TEST TEST TEST")
+assert readme.text.contains("# openapi-jaxrs-server")
+assert readme.text.contains("OpenAPI Petstore")
+
+File mavenPomXml = new File(basedir, "out/pom.xml")
+assert mavenPomXml.isFile()
+
+File petApi = new File(basedir, "out/src/gen/java/org/openapitools/api/PetApi.java")
+assert petApi.isFile()
+assert petApi.text.contains("import org.openapitools.api.PetApiService;")
+
+File petApiService = new File(basedir, "out/src/gen/java/org/openapitools/api/PetApiService.java")
+assert petApiService.isFile()
+assert petApiService.text.contains("import jakarta.ws.rs.core.Response;")
+
+File petModel = new File(basedir, "out/src/gen/java/org/openapitools/model/Pet.java")
+assert petModel.isFile()
+assert petModel.text.contains("public class Pet")
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 d887357349f1..40de961a11e7 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
@@ -344,6 +344,12 @@ public class CodeGenMojo extends AbstractMojo {
@Parameter(name = "parameterNameMappings", property = "openapi.generator.maven.plugin.parameterNameMappings")
private List parameterNameMappings;
+ /**
+ * A map of model names and the new names
+ */
+ @Parameter(name = "modelNameMappings", property = "openapi.generator.maven.plugin.modelNameMappings")
+ private List modelNameMappings;
+
/**
* A set of rules for OpenAPI normalizer
*/
@@ -514,15 +520,6 @@ public void execute() throws MojoExecutionException {
"generated-test-sources/openapi" : "generated-sources/openapi");
}
- if (cleanupOutput) {
- try {
- FileUtils.deleteDirectory(output);
- LOGGER.info("Previous run output is removed from {}", output);
- } catch (IOException e) {
- LOGGER.warn("Failed to clean-up output directory {}", output, e);
- }
- }
-
addCompileSourceRootIfConfigured();
try {
@@ -560,10 +557,19 @@ public void execute() throws MojoExecutionException {
}
}
+ if (cleanupOutput) {
+ try {
+ FileUtils.deleteDirectory(output);
+ LOGGER.info("Previous run output is removed from {}", output);
+ } catch (IOException e) {
+ LOGGER.warn("Failed to clean up output directory {}", output, e);
+ }
+ }
+
// attempt to read from config file
CodegenConfigurator configurator = CodegenConfigurator.fromFile(configurationFile);
- // if a config file wasn't specified or we were unable to read it
+ // if a config file wasn't specified, or we were unable to read it
if (configurator == null) {
configurator = new CodegenConfigurator();
}
@@ -823,6 +829,11 @@ public void execute() throws MojoExecutionException {
applyParameterNameMappingsKvpList(parameterNameMappings, configurator);
}
+ // Apply Model Name Mappings
+ if (modelNameMappings != null && (configOptions == null || !configOptions.containsKey("model-name-mappings"))) {
+ applyModelNameMappingsKvpList(modelNameMappings, configurator);
+ }
+
// Apply OpenAPI normalizer rules
if (openapiNormalizer != null && (configOptions == null || !configOptions.containsKey("openapi-normalizer"))) {
applyOpenAPINormalizerKvpList(openapiNormalizer, configurator);
@@ -927,8 +938,8 @@ public void execute() throws MojoExecutionException {
/**
* Calculate openapi specification file hash. If specification is hosted on remote resource it is downloaded first
*
- * @param inputSpecFile - Openapi specification input file to calculate it's hash.
- * Does not taken into account if input spec is hosted on remote resource
+ * @param inputSpecFile - Openapi specification input file to calculate its hash.
+ * Does not take into account if input spec is hosted on remote resource
* @return openapi specification file hash
* @throws IOException
*/
@@ -980,8 +991,8 @@ private URL inputSpecRemoteUrl(){
/**
* Get specification hash file
- * @param inputSpecFile - Openapi specification input file to calculate it's hash.
- * Does not taken into account if input spec is hosted on remote resource
+ * @param inputSpecFile - Openapi specification input file to calculate its hash.
+ * Does not take into account if input spec is hosted on remote resource
* @return a file with previously calculated hash
*/
private File getHashFile(File inputSpecFile) {
diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml
index b1a3fc82a5a0..3ef2e372a8d7 100644
--- a/modules/openapi-generator-online/pom.xml
+++ b/modules/openapi-generator-online/pom.xml
@@ -4,7 +4,7 @@
org.openapitoolsopenapi-generator-project
- 7.0.0-SNAPSHOT
+ 7.1.0-SNAPSHOT../..
diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml
index f7fe4442e6a5..f55c4d55abe6 100644
--- a/modules/openapi-generator/pom.xml
+++ b/modules/openapi-generator/pom.xml
@@ -4,7 +4,7 @@
org.openapitoolsopenapi-generator-project
- 7.0.0-SNAPSHOT
+ 7.1.0-SNAPSHOT../..
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ClientOptInput.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ClientOptInput.java
index 0d95bb4aef9b..cf5960cf6334 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/ClientOptInput.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/ClientOptInput.java
@@ -22,11 +22,13 @@
import org.openapitools.codegen.api.TemplateDefinition;
import org.openapitools.codegen.auth.AuthParser;
+import org.openapitools.codegen.config.GeneratorSettings;
import java.util.List;
public class ClientOptInput {
private CodegenConfig config;
+ private GeneratorSettings generatorSettings;
private OpenAPI openAPI;
private List auths;
private List userDefinedTemplates;
@@ -36,6 +38,11 @@ public ClientOptInput openAPI(OpenAPI openAPI) {
return this;
}
+ public ClientOptInput generatorSettings(GeneratorSettings generatorSettings) {
+ this.setGeneratorSettings(generatorSettings);
+ return this;
+ }
+
public ClientOptInput config(CodegenConfig codegenConfig) {
this.setConfig(codegenConfig);
return this;
@@ -92,6 +99,20 @@ public void setConfig(CodegenConfig config) {
}
}
+ @Deprecated
+ public GeneratorSettings getGeneratorSettings() {
+ return generatorSettings;
+ }
+
+ @Deprecated
+ private void setGeneratorSettings(GeneratorSettings generatorSettings) {
+ this.generatorSettings = generatorSettings;
+ // TODO: ClientOptInputs needs to be retired
+ if (this.openAPI != null) {
+ this.config.setOpenAPI(this.openAPI);
+ }
+ }
+
@Deprecated
public OpenAPI getOpenAPI() {
return openAPI;
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java
index 5bcd76b73754..59651d41e40c 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java
@@ -55,6 +55,8 @@ public interface CodegenConfig {
Map vendorExtensions();
+ Map templateOutputDirs();
+
String testPackage();
String apiPackage();
@@ -151,6 +153,8 @@ public interface CodegenConfig {
Map parameterNameMapping();
+ Map modelNameMapping();
+
Map openapiNormalizer();
Map apiTemplateFiles();
@@ -217,8 +221,12 @@ public interface CodegenConfig {
String modelFilename(String templateName, String modelName);
+ String modelFilename(String templateName, String modelName, String outputDir);
+
String apiFilename(String templateName, String tag);
+ String apiFilename(String templateName, String tag, String outputDir);
+
String apiTestFilename(String templateName, String tag);
String apiDocFilename(String templateName, String tag);
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java
index 6c2b91caa932..cabdf4d911de 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java
@@ -123,9 +123,16 @@ public static class MappedModel implements Comparable{
private CodegenModel model;
- public MappedModel(String mappingName, String modelName) {
+ private final boolean explicitMapping;
+
+ public MappedModel(String mappingName, String modelName, boolean explicitMapping) {
this.mappingName = mappingName;
this.modelName = modelName;
+ this.explicitMapping = explicitMapping;
+ }
+
+ public MappedModel(String mappingName, String modelName) {
+ this(mappingName, modelName, false);
}
@Override
@@ -137,7 +144,14 @@ public int compareTo(MappedModel other) {
} else if (other.getMappingName() == null) {
return -1;
}
- return getMappingName().compareTo(other.getMappingName());
+
+ // prioritize mappings based on mappings in the spec before any auto-generated
+ // so that during serialization the proper values are used in the json
+ if (explicitMapping != other.explicitMapping) {
+ return explicitMapping ? -1 : 1;
+ } else {
+ return getMappingName().compareTo(other.getMappingName());
+ }
}
public String getMappingName() {
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java
index 6c2842fec4cd..4c2d8bc5b170 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java
@@ -149,7 +149,10 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
public String additionalPropertiesType;
/**
- * True if additionalProperties is set to true (boolean value)
+ * True if additionalProperties is set to true (boolean value), any type, free form object, etc
+ *
+ * TODO: we may rename this to isAdditionalPropertiesEnabled or something
+ * else to avoid confusions
*/
public boolean isAdditionalPropertiesTrue;
@@ -996,6 +999,82 @@ public void setHasMultipleTypes(boolean hasMultipleTypes) {
this.hasMultipleTypes = hasMultipleTypes;
}
+ @Override
+ public boolean getIsFloat() {
+ return isFloat;
+ }
+
+ @Override
+ public void setIsFloat(boolean isFloat) {
+ this.isFloat = isFloat;
+ }
+
+ @Override
+ public boolean getIsDouble() {
+ return isDouble;
+ }
+
+ @Override
+ public void setIsDouble(boolean isDouble) {
+ this.isDouble = isDouble;
+ }
+
+ @Override
+ public boolean getIsInteger() {
+ return isInteger;
+ }
+
+ @Override
+ public void setIsInteger(boolean isInteger) {
+ this.isInteger = isInteger;
+ }
+
+ @Override
+ public boolean getIsLong() {
+ return isLong;
+ }
+
+ @Override
+ public void setIsLong(boolean isLong) {
+ this.isLong = isLong;
+ }
+
+ @Override
+ public boolean getIsBinary() {
+ return false;
+ }
+
+ @Override
+ public void setIsBinary(boolean isBinary) {}
+
+ @Override
+ public boolean getIsByteArray() {
+ return false;
+ }
+
+ @Override
+ public void setIsByteArray(boolean isByteArray) {}
+
+ @Override
+ public boolean getIsDecimal() {
+ return isDecimal;
+ }
+
+ @Override
+ public void setIsDecimal(boolean isDecimal) {
+ this.isDecimal = isDecimal;
+ }
+
+ @Override
+ public boolean getIsEnum() {
+ return isEnum;
+ }
+
+ @Override
+ public void setIsEnum(boolean isEnum) {
+ this.isEnum = isEnum;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
@@ -1088,6 +1167,7 @@ public boolean equals(Object o) {
Objects.equals(externalDocumentation, that.externalDocumentation) &&
Objects.equals(vendorExtensions, that.vendorExtensions) &&
Objects.equals(additionalPropertiesType, that.additionalPropertiesType) &&
+ Objects.equals(isAdditionalPropertiesTrue, that.isAdditionalPropertiesTrue) &&
Objects.equals(getMaxProperties(), that.getMaxProperties()) &&
Objects.equals(getMinProperties(), that.getMinProperties()) &&
Objects.equals(getMaxItems(), that.getMaxItems()) &&
@@ -1193,6 +1273,7 @@ public String toString() {
sb.append(", externalDocumentation=").append(externalDocumentation);
sb.append(", vendorExtensions=").append(vendorExtensions);
sb.append(", additionalPropertiesType='").append(additionalPropertiesType).append('\'');
+ sb.append(", isAdditionalPropertiesTrue='").append(isAdditionalPropertiesTrue).append('\'');
sb.append(", maxProperties=").append(maxProperties);
sb.append(", minProperties=").append(minProperties);
sb.append(", uniqueItems=").append(uniqueItems);
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java
index d928016ce94e..ab9382911872 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java
@@ -30,7 +30,7 @@ public class CodegenOperation {
hasVersionHeaders = false, hasVersionQueryParams = false,
isResponseBinary = false, isResponseFile = false, isResponseOptional = false, hasReference = false, defaultReturnType = false,
isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy,
- isRestful, isDeprecated, isCallbackRequest, uniqueItems, hasDefaultResponse = false,
+ isRestful, isDeprecated, isCallbackRequest, uniqueItems, hasDefaultResponse = false, hasConstantParams = false,
hasErrorResponseObject; // if 4xx, 5xx responses have at least one error object defined
public CodegenProperty returnProperty;
public String path, operationId, returnType, returnFormat, httpMethod, returnBaseType,
@@ -45,6 +45,7 @@ public class CodegenOperation {
public List queryParams = new ArrayList();
public List headerParams = new ArrayList();
public List implicitHeadersParams = new ArrayList();
+ public List constantParams = new ArrayList();
public List formParams = new ArrayList();
public List cookieParams = new ArrayList();
public List requiredParams = new ArrayList();
@@ -392,6 +393,7 @@ public String toString() {
sb.append(", operationIdLowerCase='").append(operationIdLowerCase).append('\'');
sb.append(", operationIdCamelCase='").append(operationIdCamelCase).append('\'');
sb.append(", operationIdSnakeCase='").append(operationIdSnakeCase).append('\'');
+ sb.append(", constantParams='").append(constantParams).append('\'');
sb.append('}');
return sb.toString();
}
@@ -472,7 +474,8 @@ public boolean equals(Object o) {
Objects.equals(operationIdOriginal, that.operationIdOriginal) &&
Objects.equals(operationIdLowerCase, that.operationIdLowerCase) &&
Objects.equals(operationIdCamelCase, that.operationIdCamelCase) &&
- Objects.equals(operationIdSnakeCase, that.operationIdSnakeCase);
+ Objects.equals(operationIdSnakeCase, that.operationIdSnakeCase) &&
+ Objects.equals(constantParams, that.constantParams);
}
@Override
@@ -488,6 +491,6 @@ public int hashCode() {
pathParams, queryParams, headerParams, formParams, cookieParams, requiredParams, returnProperty, optionalParams,
authMethods, tags, responses, callbacks, imports, examples, requestBodyExamples, externalDocs,
vendorExtensions, nickname, operationIdOriginal, operationIdLowerCase, operationIdCamelCase,
- operationIdSnakeCase, hasErrorResponseObject, requiredAndNotNullableParams, notNullableParams);
+ operationIdSnakeCase, hasErrorResponseObject, requiredAndNotNullableParams, notNullableParams, constantParams);
}
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java
index cacd9a8b325a..70da32747676 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java
@@ -17,9 +17,14 @@
package org.openapitools.codegen;
-import io.swagger.v3.oas.models.examples.Example;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
-import java.util.*;
+import io.swagger.v3.oas.models.examples.Example;
/**
* Describes a single operation parameter in the OAS specification.
@@ -29,7 +34,7 @@
public class CodegenParameter implements IJsonSchemaValidationProperties {
public boolean isFormParam, isQueryParam, isPathParam, isHeaderParam,
isCookieParam, isBodyParam, isContainer,
- isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject, isAllowEmptyValue;
+ isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject, isMatrix, isAllowEmptyValue;
public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, contentType,
collectionFormat, description, unescapedDescription, baseType, defaultValue, enumDefaultValue, enumName, style;
@@ -251,6 +256,7 @@ public CodegenParameter copy() {
output.isExplode = this.isExplode;
output.style = this.style;
output.isDeepObject = this.isDeepObject;
+ output.isMatrix = this.isMatrix;
output.isAllowEmptyValue = this.isAllowEmptyValue;
output.contentType = this.contentType;
@@ -259,7 +265,7 @@ public CodegenParameter copy() {
@Override
public int hashCode() {
- return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, containerType, containerTypeMapped, defaultValue, enumDefaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, examples, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, isEnumRef, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, isVoid, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties);
+ return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, containerType, containerTypeMapped, defaultValue, enumDefaultValue, enumName, style, isDeepObject, isMatrix, isAllowEmptyValue, example, examples, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, isEnumRef, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, isVoid, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties);
}
@Override
@@ -341,6 +347,7 @@ public boolean equals(Object o) {
Objects.equals(enumName, that.enumName) &&
Objects.equals(style, that.style) &&
Objects.equals(isDeepObject, that.isDeepObject) &&
+ Objects.equals(isMatrix, that.isMatrix) &&
Objects.equals(isAllowEmptyValue, that.isAllowEmptyValue) &&
Objects.equals(example, that.example) &&
Objects.equals(examples, that.examples) &&
@@ -405,6 +412,7 @@ public String toString() {
sb.append(", enumName='").append(enumName).append('\'');
sb.append(", style='").append(style).append('\'');
sb.append(", deepObject='").append(isDeepObject).append('\'');
+ sb.append(", isMatrix='").append(isMatrix).append('\'');
sb.append(", allowEmptyValue='").append(isAllowEmptyValue).append('\'');
sb.append(", example='").append(example).append('\'');
sb.append(", examples='").append(examples).append('\'');
@@ -994,5 +1002,105 @@ public boolean getSchemaIsFromAdditionalProperties() {
public void setSchemaIsFromAdditionalProperties(boolean schemaIsFromAdditionalProperties) {
this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties;
}
+
+ @Override
+ public String getDataType() {
+ return dataType;
+ }
+
+ @Override
+ public void setDataType(String dataType) {
+ this.dataType = dataType;
+ }
+
+ @Override
+ public boolean getIsFloat() {
+ return isFloat;
+ }
+
+ @Override
+ public void setIsFloat(boolean isFloat) {
+ this.isFloat = isFloat;
+ }
+
+ @Override
+ public boolean getIsDouble() {
+ return isDouble;
+ }
+
+ @Override
+ public void setIsDouble(boolean isDouble) {
+ this.isDouble = isDouble;
+ }
+
+ @Override
+ public boolean getIsInteger() {
+ return isInteger;
+ }
+
+ @Override
+ public void setIsInteger(boolean isInteger) {
+ this.isInteger = isInteger;
+ }
+
+ @Override
+ public boolean getIsLong() {
+ return isLong;
+ }
+
+ @Override
+ public void setIsLong(boolean isLong) {
+ this.isLong = isLong;
+ }
+
+ @Override
+ public boolean getIsBinary() {
+ return isBinary;
+ }
+
+ @Override
+ public void setIsBinary(boolean isBinary) {
+ this.isBinary = isBinary;
+ }
+
+ @Override
+ public boolean getIsByteArray() {
+ return isByteArray;
+ }
+
+ @Override
+ public void setIsByteArray(boolean isByteArray) {
+ this.isByteArray = isByteArray;
+ }
+
+ @Override
+ public boolean getIsDecimal() {
+ return isDecimal;
+ }
+
+ @Override
+ public void setIsDecimal(boolean isDecimal) {
+ this.isDecimal = isDecimal;
+ }
+
+ @Override
+ public boolean getIsUuid() {
+ return isUuid;
+ }
+
+ @Override
+ public void setIsUuid(boolean isUuid) {
+ this.isUuid = isUuid;
+ }
+
+ @Override
+ public boolean getIsEnum() {
+ return isEnum;
+ }
+
+ @Override
+ public void setIsEnum(boolean isEnum) {
+ this.isEnum = isEnum;
+ }
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java
index 40c2d9bdfb92..eb5e7044f8f3 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java
@@ -17,7 +17,12 @@
package org.openapitools.codegen;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperties {
/**
@@ -317,10 +322,18 @@ public String getDataType() {
return dataType;
}
+ /**
+ * @deprecated use {@link #setDataType()} instead.
+ */
+ @Deprecated
public void setDatatype(String datatype) {
this.dataType = datatype;
}
+ public void setDataType(String dataType) {
+ this.dataType = dataType;
+ }
+
public String getDatatypeWithEnum() {
return datatypeWithEnum;
}
@@ -1027,6 +1040,76 @@ public void setRequiredVarsMap(Map requiredVarsMap) {
this.requiredVarsMap = requiredVarsMap;
}
+ @Override
+ public boolean getIsFloat() {
+ return isFloat;
+ }
+
+ @Override
+ public void setIsFloat(boolean isFloat) {
+ this.isFloat = isFloat;
+ }
+
+ @Override
+ public boolean getIsDouble() {
+ return isDouble;
+ }
+
+ @Override
+ public void setIsDouble(boolean isDouble) {
+ this.isDouble = isDouble;
+ }
+
+ @Override
+ public boolean getIsInteger() {
+ return isInteger;
+ }
+
+ @Override
+ public void setIsInteger(boolean isInteger) {
+ this.isInteger = isInteger;
+ }
+
+ @Override
+ public boolean getIsLong() {
+ return isLong;
+ }
+
+ @Override
+ public void setIsLong(boolean isLong) {
+ this.isLong = isLong;
+ }
+
+ @Override
+ public boolean getIsBinary() {
+ return isBinary;
+ }
+
+ @Override
+ public void setIsBinary(boolean isBinary) {
+ this.isBinary = isBinary;
+ }
+
+ @Override
+ public boolean getIsByteArray() {
+ return isByteArray;
+ }
+
+ @Override
+ public void setIsByteArray(boolean isByteArray) {
+ this.isByteArray = isByteArray;
+ }
+
+ @Override
+ public boolean getIsDecimal() {
+ return isDecimal;
+ }
+
+ @Override
+ public void setIsDecimal(boolean isDecimal) {
+ this.isDecimal = isDecimal;
+ }
+
/**
* Return true if it's an enum (inline or ref)
*
@@ -1036,6 +1119,16 @@ public boolean getIsEnumOrRef() {
return isEnum || isEnumRef;
}
+ @Override
+ public boolean getIsEnum() {
+ return isEnum;
+ }
+
+ @Override
+ public void setIsEnum(boolean isEnum) {
+ this.isEnum = isEnum;
+ }
+
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("CodegenProperty{");
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java
index a9538eb4333f..e8d9090d5e90 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java
@@ -95,6 +95,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
private LinkedHashMap content;
private Map requiredVarsMap;
private String ref;
+ public CodegenProperty returnProperty;
private boolean schemaIsFromAdditionalProperties;
@Override
@@ -542,6 +543,16 @@ public void setHasRequired(boolean hasRequired) {
this.hasRequired = hasRequired;
}
+ @Override
+ public boolean getIsUuid() {
+ return isUuid;
+ }
+
+ @Override
+ public void setIsUuid(boolean isUuid) {
+ this.isUuid = isUuid;
+ }
+
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("CodegenResponse{");
@@ -790,4 +801,92 @@ public boolean getSchemaIsFromAdditionalProperties() {
public void setSchemaIsFromAdditionalProperties(boolean schemaIsFromAdditionalProperties) {
this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties;
}
+
+ @Override
+ public String getDataType() {
+ return dataType;
+ }
+
+ @Override
+ public void setDataType(String dataType) {
+ this.dataType = dataType;
+ }
+
+ @Override
+ public boolean getIsFloat() {
+ return isFloat;
+ }
+
+ @Override
+ public void setIsFloat(boolean isFloat) {
+ this.isFloat = isFloat;
+ }
+
+ @Override
+ public boolean getIsDouble() {
+ return isDouble;
+ }
+
+ @Override
+ public void setIsDouble(boolean isDouble) {
+ this.isDouble = isDouble;
+ }
+
+ @Override
+ public boolean getIsInteger() {
+ return isInteger;
+ }
+
+ @Override
+ public void setIsInteger(boolean isInteger) {
+ this.isInteger = isInteger;
+ }
+
+ @Override
+ public boolean getIsLong() {
+ return isLong;
+ }
+
+ @Override
+ public void setIsLong(boolean isLong) {
+ this.isLong = isLong;
+ }
+
+ @Override
+ public boolean getIsBinary() {
+ return isBinary;
+ }
+
+ @Override
+ public void setIsBinary(boolean isBinary) {
+ this.isBinary = isBinary;
+ }
+
+ @Override
+ public boolean getIsByteArray() {
+ return isByteArray;
+ }
+
+ @Override
+ public void setIsByteArray(boolean isByteArray) {
+ this.isByteArray = isByteArray;
+ }
+
+ @Override
+ public boolean getIsDecimal() {
+ return isDecimal;
+ }
+
+ @Override
+ public void setIsDecimal(boolean isDecimal) {
+ this.isDecimal = isDecimal;
+ }
+
+ @Override
+ public boolean getIsEnum() {
+ return false;
+ }
+
+ @Override
+ public void setIsEnum(boolean isEnum) {}
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java
index e76d927bfbe4..72587604a53c 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java
@@ -89,6 +89,10 @@ public CodegenSecurity (CodegenSecurity original) {
public CodegenSecurity filterByScopeNames(List filterScopes) {
CodegenSecurity filteredSecurity = new CodegenSecurity(this);
+ if (scopes == null) {
+ return filteredSecurity;
+ }
+
List