diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 852af4f85a12..e88ba6dda640 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,7 +8,7 @@ - [ ] Run the following to [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) and update samples: ``` ./mvnw clean package - ./bin/generate-samples.sh + ./bin/generate-samples.sh ./bin/configs/*.yaml ./bin/utils/export_docs_generators.sh ``` Commit all changed files. @@ -16,10 +16,5 @@ These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`. For Windows users, please run the script in [Git BASH](https://gitforwindows.org/). -- [ ] In case you are adding a new generator, run the following additional script : - ``` - ./bin/utils/ensure-up-to-date - ``` - Commit all changed files. -- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (7.0.1 - patch release), `7.1.x` (minor release - breaking changes with fallbacks), `8.0.x` (breaking changes without fallbacks) +- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (upcoming 7.1.0 minor release - breaking changes with fallbacks), `8.0.x` (breaking changes without fallbacks) - [ ] If your PR is targeting a particular programming language, @mention the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) members, so they are more likely to review the pull request. diff --git a/.github/workflows/samples-dotnet6-client-echo-api.yaml b/.github/workflows/samples-dotnet6-client-echo-api.yaml index 17754bb8aded..a0dcb8a58c2a 100644 --- a/.github/workflows/samples-dotnet6-client-echo-api.yaml +++ b/.github/workflows/samples-dotnet6-client-echo-api.yaml @@ -28,4 +28,6 @@ jobs: (cd http-echo-server && npm install && npm start &) - name: Build working-directory: ${{ matrix.sample }} - run: dotnet build Org.OpenAPITools.sln + run: | + dotnet build Org.OpenAPITools.sln + dotnet test Org.OpenAPITools.sln diff --git a/.github/workflows/samples-java-server-jdk8.yaml b/.github/workflows/samples-java-server-jdk8.yaml index 73e4bcfb0b84..342a624b0c79 100644 --- a/.github/workflows/samples-java-server-jdk8.yaml +++ b/.github/workflows/samples-java-server-jdk8.yaml @@ -8,6 +8,7 @@ on: - 'samples/server/petstore/java-vertx-web/**' - 'samples/server/petstore/java-inflector/**' - 'samples/server/petstore/java-pkmst/**' + # test in circleci instead - 'samples/server/petstore/java-undertow/**' pull_request: paths: @@ -15,7 +16,7 @@ on: - 'samples/server/petstore/java-vertx-web/**' - 'samples/server/petstore/java-inflector/**' - 'samples/server/petstore/java-pkmst/**' - - 'samples/server/petstore/java-undertow/**' + #- 'samples/server/petstore/java-undertow/**' jobs: build: name: Build Java Server @@ -29,7 +30,7 @@ jobs: - samples/server/petstore/java-vertx-web/ - samples/server/petstore/java-inflector/ - samples/server/petstore/java-pkmst/ - - samples/server/petstore/java-undertow/ + #- samples/server/petstore/java-undertow/ steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v3 diff --git a/.gitignore b/.gitignore index 33731657c228..d632589eb6c1 100644 --- a/.gitignore +++ b/.gitignore @@ -212,6 +212,7 @@ samples/server/petstore/kotlin-server/ktor/build samples/server/petstore/kotlin-springboot/build samples/client/petstore/kotlin*/src/main/kotlin/test/ samples/client/petstore/kotlin*/build/ +samples/server/others/kotlin-server/jaxrs-spec/build/ # haskell .stack-work diff --git a/.java-version b/.java-version index 6259340971be..b4de39476753 100644 --- a/.java-version +++ b/.java-version @@ -1 +1 @@ -1.8 +11 diff --git a/README.md b/README.md index 76abf4179edb..2f24e3798969 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@
](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
@@ -77,7 +79,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
| **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,13 +117,13 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
| OpenAPI Generator Version | Release Date | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
-| 7.0.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.0.1-SNAPSHOT/) | 08.09.2023 | Patch release (enhancements, bug fixes, etc) |
-| [7.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.0.0) (latest stable release) | 25.08.2023 | Major release with breaking changes (no 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)
@@ -179,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/7.0.0/openapi-generator-cli-7.0.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/7.0.0/openapi-generator-cli-7.0.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/7.0.0/openapi-generator-cli-7.0.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.
@@ -423,7 +425,7 @@ openapi-generator-cli version
To use a specific version of "openapi-generator-cli"
```sh
-openapi-generator-cli version-manager set 7.0.0
+openapi-generator-cli version-manager set 7.0.1
```
Or install it as dev-dependency:
@@ -447,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/7.0.0/openapi-generator-cli-7.0.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`
@@ -928,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.
@@ -1004,6 +1003,7 @@ 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
* Rust: @farcaller
@@ -1168,7 +1168,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) |
@@ -1262,3 +1262,4 @@ 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/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/java-undertow-server-java-undertow.yaml b/bin/configs/java-undertow-server.yaml
similarity index 78%
rename from bin/configs/java-undertow-server-java-undertow.yaml
rename to bin/configs/java-undertow-server.yaml
index 2cbb1160f171..0abaa522f85a 100644
--- a/bin/configs/java-undertow-server-java-undertow.yaml
+++ b/bin/configs/java-undertow-server.yaml
@@ -1,6 +1,6 @@
generatorName: java-undertow-server
outputDir: samples/server/petstore/java-undertow
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
+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/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
index 50d05c086efb..e8db9d729c2d 100644
--- a/bin/configs/php-nextgen.yaml
+++ b/bin/configs/php-nextgen.yaml
@@ -1,4 +1,4 @@
generatorName: php-nextgen
outputDir: samples/client/petstore/php-nextgen/OpenAPIClient-php
-inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
+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/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/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md
index b0580d7318c1..692e14c1d726 100644
--- a/docs/generators/kotlin-server.md
+++ b/docs/generators/kotlin-server.md
@@ -39,7 +39,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|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/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml
index f179a970f1b3..04f273dad27b 100644
--- a/modules/openapi-generator-cli/pom.xml
+++ b/modules/openapi-generator-cli/pom.xml
@@ -4,7 +4,7 @@