diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 09cbbfdeac3..4466e9f51fb 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,5 +16,5 @@ These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`. For Windows users, please run the script in [Git BASH](https://gitforwindows.org/). -- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (6.0.1) (patch release), `6.1.x` (breaking changes with fallbacks), `7.0.x` (breaking changes without fallbacks) +- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (6.1.0) (minor release - breaking changes with fallbacks), `7.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/gradle-test.yaml b/.github/workflows/gradle-test.yaml index 09ad3815645..067377c11f1 100644 --- a/.github/workflows/gradle-test.yaml +++ b/.github/workflows/gradle-test.yaml @@ -32,6 +32,7 @@ jobs: - samples/openapi3/client/petstore/java/jersey2-java8-special-characters - samples/openapi3/client/petstore/java/jersey2-java8 - samples/client/petstore/java/okhttp-gson + - samples/client/petstore/java/okhttp-gson-group-parameter steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 diff --git a/.github/workflows/samples-dotnet.yaml b/.github/workflows/samples-dotnet.yaml index 4c618c21dfd..fc2fab472a8 100644 --- a/.github/workflows/samples-dotnet.yaml +++ b/.github/workflows/samples-dotnet.yaml @@ -5,10 +5,12 @@ on: paths: - 'samples/client/petstore/csharp-netcore/**net6.0**/' - 'samples/server/petstore/aspnetcore-6.0/**' + - 'samples/server/petstore/aspnetcore-6.0-pocoModels/**' pull_request: paths: - 'samples/client/petstore/csharp-netcore/**net6.0**/' - 'samples/server/petstore/aspnetcore-6.0/**' + - 'samples/server/petstore/aspnetcore-6.0-pocoModels/**' jobs: build: name: Build .Net projects @@ -21,6 +23,7 @@ jobs: - samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0 - samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt - samples/server/petstore/aspnetcore-6.0 + - samples/server/petstore/aspnetcore-6.0-pocoModels steps: - uses: actions/checkout@v3 - uses: actions/setup-dotnet@v2 diff --git a/.github/workflows/samples-jdk17.yaml b/.github/workflows/samples-jdk17.yaml new file mode 100644 index 00000000000..36b76e03474 --- /dev/null +++ b/.github/workflows/samples-jdk17.yaml @@ -0,0 +1,43 @@ +name: Samples JDK17 +on: + push: + paths: + # clients + - samples/openapi3/client/petstore/spring-cloud-3 + # servers + - samples/openapi3/server/petstore/springboot-3 + pull_request: + paths: + # clients + - samples/openapi3/client/petstore/spring-cloud-3 + # servers + - samples/openapi3/server/petstore/springboot-3 +jobs: + build: + name: Build with JDK17 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # clients + - samples/openapi3/client/petstore/spring-cloud-3 + # servers + - samples/openapi3/server/petstore/springboot-3 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 17 + - name: Cache maven dependencies + uses: actions/cache@v3 + env: + cache-name: maven-repository + with: + path: | + ~/.m2 + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + - name: Build + working-directory: ${{ matrix.sample }} + run: mvn clean package diff --git a/.github/workflows/samples-php7.yaml b/.github/workflows/samples-php7.yaml new file mode 100644 index 00000000000..f675345bff5 --- /dev/null +++ b/.github/workflows/samples-php7.yaml @@ -0,0 +1,32 @@ +name: Samples PHP 7.x + +on: + push: + paths: + - samples/server/petstore/php-laravel/lib/ + pull_request: + paths: + - samples/server/petstore/php-laravel/lib/ +jobs: + build: + name: Build PHP projects + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # servers + - samples/server/petstore/php-laravel/lib/ + steps: + - uses: actions/checkout@v3 + - name: Setup PHP with tools + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + tools: php-cs-fixer, phpunit + - name: composer install + working-directory: ${{ matrix.sample }} + run: composer install + - name: phpunit + working-directory: ${{ matrix.sample }} + run: vendor/bin/phpunit diff --git a/.github/workflows/samples-php8.yaml b/.github/workflows/samples-php8.yaml new file mode 100644 index 00000000000..18c279bc3c6 --- /dev/null +++ b/.github/workflows/samples-php8.yaml @@ -0,0 +1,32 @@ +name: Samples PHP 8.x + +on: + push: + paths: + - samples/server/petstore/php-symfony/SymfonyBundle-php/ + pull_request: + paths: + - samples/server/petstore/php-symfony/SymfonyBundle-php/ +jobs: + build: + name: Build PHP projects + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # servers + - samples/server/petstore/php-symfony/SymfonyBundle-php/ + steps: + - uses: actions/checkout@v3 + - name: Setup PHP with tools + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + tools: php-cs-fixer, phpunit + - name: composer install + working-directory: ${{ matrix.sample }} + run: composer install + - name: phpunit + working-directory: ${{ matrix.sample }} + run: vendor/bin/phpunit diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index aa3371a9b07..941c9f3ad2e 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -40,6 +40,7 @@ jobs: - samples/server/petstore/spring-boot-nullable-set - samples/server/petstore/spring-boot-defaultInterface-unhandledException - samples/openapi3/server/petstore/spring-boot-oneof + - samples/server/petstore/springboot-virtualan steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 diff --git a/.gitignore b/.gitignore index 51271442043..c31896c826d 100644 --- a/.gitignore +++ b/.gitignore @@ -222,6 +222,8 @@ samples/server/petstore/haskell-yesod/stack.yaml.lock .Rproj.user samples/client/petstore/R/**/petstore.Rcheck/ samples/client/petstore/R/**/*.tar.gz +samples/client/petstore/R/R.Rproj +samples/client/petstore/R/man/ # elixir samples/client/petstore/elixir/_build/ @@ -266,3 +268,6 @@ samples/client/petstore/crystal/lib # Go samples/openapi3/client/petstore/go/privatekey.pem + +## OCaml +samples/client/petstore/ocaml/_build/ diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000000..1dd7933eff1 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,137 @@ +## Learn more about this file at 'https://www.gitpod.io/docs/references/gitpod-yml' +## +## This '.gitpod.yml' file when placed at the root of a project instructs +## Gitpod how to prepare & build the project, start development environments +## and configure continuous prebuilds. Prebuilds when enabled builds a project +## like a CI server so you can start coding right away - no more waiting for +## dependencies to download and builds to finish when reviewing pull-requests +## or hacking on something new. +## +## With Gitpod you can develop software from any device (even iPads) via +## desktop or browser based versions of VS Code or any JetBrains IDE and +## customise it to your individual needs - from themes to extensions, you +## have full control. +## +## The easiest way to try out Gitpod is install the browser extenion: +## 'https://www.gitpod.io/docs/browser-extension' or by prefixing +## 'https://gitpod.io#' to the source control URL of any project. +## +## For example: 'https://gitpod.io#https://github.com/gitpod-io/gitpod' + + +## The 'image' section defines which Docker image Gitpod should use. +## By default, Gitpod uses a standard Docker Image called 'workspace-full' +## which can be found at 'https://github.com/gitpod-io/workspace-images' +## +## Workspaces started based on this default image come pre-installed with +## Docker, Go, Java, Node.js, C/C++, Python, Ruby, Rust, PHP as well as +## tools such as Homebrew, Tailscale, Nginx and several more. +## +## If this image does not include the tools needed for your project then +## a public Docker image or your own Docker file can be configured. +## +## Learn more about images at 'https://www.gitpod.io/docs/config-docker' + +#image: node:buster # use 'https://hub.docker.com/_/node' +# +#image: # leave image undefined if using a Dockerfile +# file: .gitpod.Dockerfile # relative path to the Dockerfile from the +# # root of the project + +## The 'tasks' section defines how Gitpod prepares and builds this project +## or how Gitpod can start development servers. With Gitpod, there are three +## types of tasks: +## +## - before: Use this for tasks that need to run before init and before command. +## - init: Use this to configure prebuilds of heavy-lifting tasks such as +## downloading dependencies or compiling source code. +## - command: Use this to start your database or application when the workspace starts. +## +## Learn more about these tasks at 'https://www.gitpod.io/docs/config-start-tasks' + +#tasks: +# - before: | +# # commands to execute... +# +# - init: | +# # sudo apt-get install python3 # can be used to install operating system +# # dependencies but these are not kept after the +# # prebuild completes thus Gitpod recommends moving +# # operating system dependency installation steps +# # to a custom Dockerfile to make prebuilds faster +# # and to keep your codebase DRY. +# # 'https://www.gitpod.io/docs/config-docker' +# +# # pip install -r requirements.txt # install codebase dependencies +# # cmake # precompile codebase +# +# - name: Web Server +# openMode: split-left +# env: +# WEBSERVER_PORT: 8080 +# command: | +# python3 -m http.server $WEBSERVER_PORT +# +# - name: Web Browser +# openMode: split-right +# env: +# WEBSERVER_PORT: 8080 +# command: | +# gp await-port $WEBSERVER_PORT +# lynx `gp url` + +tasks: + - init: ./mvnw package -DskipTests + +## The 'ports' section defines various ports your may listen on are +## configured in Gitpod on an authenticated URL. By default, all ports +## are in private visibility state. +## +## Learn more about ports at 'https://www.gitpod.io/docs/config-ports' + +#ports: +# - port: 8080 # alternatively configure entire ranges via '8080-8090' +# visibility: private # either 'public' or 'private' (default) +# onOpen: open-browser # either 'open-browser', 'open-preview' or 'ignore' + + +## The 'vscode' section defines a list of Visual Studio Code extensions from +## the OpenVSX.org registry to be installed upon workspace startup. OpenVSX +## is an open alternative to the proprietary Visual Studio Code Marketplace +## and extensions can be added by sending a pull-request with the extension +## identifier to https://github.com/open-vsx/publish-extensions +## +## The identifier of an extension is always ${publisher}.${name}. +## +## For example: 'vscodevim.vim' +## +## Learn more at 'https://www.gitpod.io/docs/ides-and-editors/vscode' + +vscode: + extensions: + - redhat.java + - vscjava.vscode-java-pack + +## The 'github' section defines configuration of continuous prebuilds +## for GitHub repositories when the GitHub application +## 'https://github.com/apps/gitpod-io' is installed in GitHub and granted +## permissions to access the repository. +## +## Learn more at 'https://www.gitpod.io/docs/prebuilds' + +github: + prebuilds: + # enable for the default branch + master: true + # enable for all branches in this repo + branches: true + # enable for pull requests coming from this repo + pullRequests: true + # enable for pull requests coming from forks + pullRequestsFromForks: true + # add a check to pull requests + addCheck: true + # add a "Review in Gitpod" button as a comment to pull requests + addComment: true + # add a "Review in Gitpod" button to the pull request's description + addBadge: false diff --git a/.travis.yml b/.travis.yml index 6816f00d0b6..0f5b038ec8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -111,11 +111,9 @@ before_install: - cmake --version # install Qt5 #- sudo apt install -y --no-install-recommends qt5-default - # -- skip perl test to shorten build time # perl dep - #- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) - #- cpanm --quiet --no-interactive Test::Exception Test::More Log::Any LWP::UserAgent URI::Query Module::Runtime DateTime Module::Find Moose::Role JSON || echo "Ignored failure from cpanm" - # -- skip perl test end + - cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) + - cpanm --quiet --no-interactive Test::Exception Test::More Log::Any LWP::UserAgent URI::Query Module::Runtime DateTime Module::Find Moose::Role JSON || echo "Ignored failure from cpanm" # show host table to confirm petstore.swagger.io is mapped to localhost - cat /etc/hosts # show java version diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 183c77c8c62..1d96dae7b13 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -80,6 +80,7 @@ elif [ "$NODE_INDEX" = "4" ]; then #mvn --no-snapshot-updates --quiet verify -Psamples.circleci.node4 -Dorg.slf4j.simpleLogger.defaultLogLevel=error (cd samples/openapi3/client/petstore/python && make test) (cd samples/openapi3/client/petstore/python-experimental && make test) + (cd samples/openapi3/client/3_0_3_unit_test/python-experimental && make test) else echo "Running node $NODE_INDEX to test 'samples.circleci.others' defined in pom.xml ..." diff --git a/README.md b/README.md index 7748c2bfeeb..277035284ee 100644 --- a/README.md +++ b/README.md @@ -3,25 +3,19 @@
-[![Stable releases in Maven Central](https://img.shields.io/maven-metadata/v/https/repo1.maven.org/maven2/org/openapitools/openapi-generator/maven-metadata.xml.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-orange)](./LICENSE) [![Open Collective backers](https://img.shields.io/opencollective/backers/openapi_generator?color=orange&label=OpenCollective%20Backers)](https://opencollective.com/openapi_generator) [![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g) [![Follow OpenAPI Generator Twitter account to get the latest update](https://img.shields.io/twitter/follow/oas_generator.svg?style=social&label=Follow)](https://twitter.com/oas_generator) +[![Stable releases in Maven Central](https://img.shields.io/maven-metadata/v/https/repo1.maven.org/maven2/org/openapitools/openapi-generator/maven-metadata.xml.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-orange)](./LICENSE) [![Open Collective backers](https://img.shields.io/opencollective/backers/openapi_generator?color=orange&label=OpenCollective%20Backers)](https://opencollective.com/openapi_generator) [![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g) [![Follow OpenAPI Generator Twitter account to get the latest update](https://img.shields.io/twitter/follow/oas_generator.svg?style=social&label=Follow)](https://twitter.com/oas_generator) [![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod)](https://gitpod.io/#https://github.com/OpenAPITools/openapi-generator)
-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`6.0.1`): +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`6.1.0`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator) [![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/master?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67) [![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/openapitools/openapi-generator/Check%20Supported%20Java%20Versions/master?label=Check%20Supported%20Java%20Versions&logo=github&logoColor=green)](https://github.com/OpenAPITools/openapi-generator/actions?query=workflow%3A%22Check+Supported+Java+Versions%22) -[6.1.x](https://github.com/OpenAPITools/openapi-generator/tree/6.1.x) (`6.1.x`): -[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/6.1.x.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) -[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/6.1.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) -[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=6.1.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator) -[![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/6.1.x?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67) - [7.0.x](https://github.com/OpenAPITools/openapi-generator/tree/7.0.x) (`7.0.x`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/7.0.x.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/7.0.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) @@ -119,9 +113,8 @@ 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/) | Feb/Mar 2023 | Major release with breaking changes (no fallback) | -| 6.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.1.0-SNAPSHOT/) | 26.07 2022 | Minor release with breaking changes (with fallbac) | -| 6.0.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.0.1-SNAPSHOT/) | 26.06 2022 | Patch release (enhancements, bug fixes, etc) | -| [6.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.0.0) (latest stable release) | 26.05.2022 | Major release with breaking changes (no fallback) | +| 6.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.1.0-SNAPSHOT/) | 03.08 2022 | Minor release with breaking changes (with fallback) | +| [6.0.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.0.1) (latest stable release) | 03.07.2022 | Patch release (enhancements, bug fixes, etc) | | [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) | @@ -179,16 +172,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 8 runtime at a minimum): -JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.0.0/openapi-generator-cli-6.0.0.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.0.1/openapi-generator-cli-6.0.1.jar` For **Mac/Linux** users: ```sh -wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.0.0/openapi-generator-cli-6.0.0.jar -O openapi-generator-cli.jar +wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.0.1/openapi-generator-cli-6.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.0.0/openapi-generator-cli-6.0.0.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.0.1/openapi-generator-cli-6.0.1.jar ``` After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. @@ -413,7 +406,7 @@ openapi-generator-cli version To use a specific version of "openapi-generator-cli" ```sh -openapi-generator-cli version-manager set 6.0.0 +openapi-generator-cli version-manager set 6.0.1 ``` Or install it as dev-dependency: @@ -437,7 +430,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.0.0/openapi-generator-cli-6.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/6.0.1/openapi-generator-cli-6.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` @@ -578,6 +571,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Aalborg University](https://www.aau.dk) - [Adaptant Solutions AG](https://www.adaptant.io/) - [adesso SE](https://www.adesso.de/) +- [Adyen](https://www.adyen.com/) - [Agoda](https://www.agoda.com/) - [Airthings](https://www.airthings.com/) - [Allianz](https://www.allianz.com) @@ -614,6 +608,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Element AI](https://www.elementai.com/) - [Embotics](https://www.embotics.com/) - [emineo](https://www.emineo.ch) +- [fastly](https://www.fastly.com/) - [Fenergo](https://www.fenergo.com/) - [freee](https://corp.freee.co.jp/en/) - [FreshCells](https://www.freshcells.de/) @@ -621,6 +616,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Gantner](https://www.gantner.com) - [GenFlow](https://github.com/RepreZen/GenFlow) - [GetYourGuide](https://www.getyourguide.com/) +- [Glovo](https://glovoapp.com/) - [GMO Pepabo](https://pepabo.com/en/) - [GoDaddy](https://godaddy.com) - [Gumtree](https://gumtree.com) @@ -868,6 +864,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2022-04-01 - [OpenAPI Generatorのコード生成とSpring Frameworkのカスタムデータバインディングを共存させる](https://techblog.zozo.com/entry/coexistence-of-openapi-and-spring) in [ZOZO Tech Blog](https://techblog.zozo.com/) - 2022-04-06 - [Effective Software Development using OpenAPI Generator](https://apexlabs.ai/post/openapi-generator) by Ajil Oommen (Senior Flutter Developer) - 2022-05-13 - [A Path From an API To Client Libraries](https://www.youtube.com/watch?v=XC8oVn_efTw) by [Filip Srnec](https://www.devoxx.co.uk/talk/?id=11211) at Infobip +- 2022-06-01 - [API First, using OpenAPI and Spring Boot](https://medium.com/xgeeks/api-first-using-openapi-and-spring-boot-2602c04bb0d3) by [Micael Estrázulas Vianna](https://estrazulas.medium.com/) ## [6 - About Us](#table-of-contents) diff --git a/bin/configs/aspnetcore-3.0.yaml b/bin/configs/aspnetcore-3.0.yaml index 762013c1696..fcf9430d8b1 100644 --- a/bin/configs/aspnetcore-3.0.yaml +++ b/bin/configs/aspnetcore-3.0.yaml @@ -1,6 +1,6 @@ generatorName: aspnetcore outputDir: samples/server/petstore/aspnetcore-3.0 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 additionalProperties: packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' diff --git a/bin/configs/aspnetcore-3.1.yaml b/bin/configs/aspnetcore-3.1.yaml index 43d84ec3803..2859ae3629d 100644 --- a/bin/configs/aspnetcore-3.1.yaml +++ b/bin/configs/aspnetcore-3.1.yaml @@ -1,6 +1,6 @@ generatorName: aspnetcore outputDir: samples/server/petstore/aspnetcore-3.1 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 additionalProperties: packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' diff --git a/bin/configs/aspnetcore-5.0.yaml b/bin/configs/aspnetcore-5.0.yaml index b4dc00c5695..fd4e6d5fc2c 100644 --- a/bin/configs/aspnetcore-5.0.yaml +++ b/bin/configs/aspnetcore-5.0.yaml @@ -1,6 +1,6 @@ generatorName: aspnetcore outputDir: samples/server/petstore/aspnetcore-5.0 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 additionalProperties: packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' diff --git a/bin/configs/aspnetcore-6.0-pocoModels.yaml b/bin/configs/aspnetcore-6.0-pocoModels.yaml new file mode 100644 index 00000000000..9e360262234 --- /dev/null +++ b/bin/configs/aspnetcore-6.0-pocoModels.yaml @@ -0,0 +1,9 @@ +generatorName: aspnetcore +outputDir: samples/server/petstore/aspnetcore-6.0-pocoModels +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 +additionalProperties: + packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' + aspnetCoreVersion: "6.0" + userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37' + pocoModels: true diff --git a/bin/configs/aspnetcore-6.0.yaml b/bin/configs/aspnetcore-6.0.yaml index 8207af4f8e5..a5cd2cc235b 100644 --- a/bin/configs/aspnetcore-6.0.yaml +++ b/bin/configs/aspnetcore-6.0.yaml @@ -1,6 +1,6 @@ generatorName: aspnetcore outputDir: samples/server/petstore/aspnetcore-6.0 -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0 additionalProperties: packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}' diff --git a/bin/configs/java-okhttp-gson-group-parameter.yaml b/bin/configs/java-okhttp-gson-group-parameter.yaml new file mode 100644 index 00000000000..936f9f0a4b0 --- /dev/null +++ b/bin/configs/java-okhttp-gson-group-parameter.yaml @@ -0,0 +1,10 @@ +generatorName: java +outputDir: samples/client/petstore/java/okhttp-gson-group-parameter +library: okhttp-gson +inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-group-parameter.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: petstore-okhttp-gson-group-parameter + hideGenerationTimestamp: "true" + disallowAdditionalPropertiesIfNotPresent: false + useSingleRequestParameter: true diff --git a/bin/configs/kotlin-allOff-discriminator.yaml b/bin/configs/kotlin-allOff-discriminator.yaml new file mode 100644 index 00000000000..0de0dd1e429 --- /dev/null +++ b/bin/configs/kotlin-allOff-discriminator.yaml @@ -0,0 +1,9 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-allOff-discriminator +inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_10792.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-allOff-discriminator + serializableModel: "false" + dateLibrary: java8 + enumUnknownDefaultCase: true diff --git a/bin/configs/other/openapi3/typescript-angular-default.yaml b/bin/configs/other/openapi3/typescript-angular-default.yaml index 7870bdd592e..0fefcc8f6f3 100644 --- a/bin/configs/other/openapi3/typescript-angular-default.yaml +++ b/bin/configs/other/openapi3/typescript-angular-default.yaml @@ -1,6 +1,6 @@ generatorName: typescript-angular -outputDir: samples/client/petstore/typescript-angular-v2/default +outputDir: samples/client/petstore/typescript-angular/default inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/typescript-angular additionalProperties: - ngVersion: "2" + ngVersion: 13.3.2 diff --git a/bin/configs/other/openapi3/typescript-angular-npm.yaml b/bin/configs/other/openapi3/typescript-angular-npm.yaml index 4234f40f8eb..4533bbcd6cb 100644 --- a/bin/configs/other/openapi3/typescript-angular-npm.yaml +++ b/bin/configs/other/openapi3/typescript-angular-npm.yaml @@ -1,10 +1,10 @@ generatorName: typescript-angular -outputDir: samples/client/petstore/typescript-angular-v4.3/npm +outputDir: samples/client/petstore/typescript-angular/npm inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/typescript-angular additionalProperties: npmVersion: 0.0.1 - ngVersion: "4.3" + ngVersion: 13.3.2 npmName: '@openapitools/angular2-typescript-petstore' npmRepository: https://skimdb.npmjs.com/registry snapshot: false diff --git a/bin/configs/other/openapi3/typescript-angular-with-interfaces.yaml b/bin/configs/other/openapi3/typescript-angular-with-interfaces.yaml index 8b5ce23861b..2b860ba10b6 100644 --- a/bin/configs/other/openapi3/typescript-angular-with-interfaces.yaml +++ b/bin/configs/other/openapi3/typescript-angular-with-interfaces.yaml @@ -1,7 +1,7 @@ generatorName: typescript-angular -outputDir: samples/client/petstore/typescript-angular-v2/with-interfaces +outputDir: samples/client/petstore/typescript-angular/with-interfaces inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/typescript-angular additionalProperties: withInterfaces: "true" - ngVersion: "2" + ngVersion: 13.3.2 diff --git a/bin/configs/php-laravel.yaml b/bin/configs/php-laravel.yaml index 2d29f5000a0..88d17374326 100644 --- a/bin/configs/php-laravel.yaml +++ b/bin/configs/php-laravel.yaml @@ -2,3 +2,5 @@ generatorName: php-laravel outputDir: samples/server/petstore/php-laravel inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/php-laravel +gitUserId: openapitools +gitRepoId: petstore diff --git a/bin/configs/php-symfony-SymfonyBundle-php.yaml b/bin/configs/php-symfony-SymfonyBundle-php.yaml index f7c6218a50f..45871b6da22 100644 --- a/bin/configs/php-symfony-SymfonyBundle-php.yaml +++ b/bin/configs/php-symfony-SymfonyBundle-php.yaml @@ -2,3 +2,5 @@ generatorName: php-symfony outputDir: samples/server/petstore/php-symfony/SymfonyBundle-php inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/php-symfony +gitUserId: openapitools +gitRepoId: petstore diff --git a/bin/configs/python-experimental_3_0_3_unit_test.yaml b/bin/configs/python-experimental_3_0_3_unit_test.yaml new file mode 100644 index 00000000000..a6428fb1ad7 --- /dev/null +++ b/bin/configs/python-experimental_3_0_3_unit_test.yaml @@ -0,0 +1,6 @@ +generatorName: python-experimental +outputDir: samples/openapi3/client/3_0_3_unit_test/python-experimental +inputSpec: modules/openapi-generator/src/test/resources/3_0/unit_test_spec/3_0_3_unit_test_spec.yaml +templateDir: modules/openapi-generator/src/main/resources/python-experimental +additionalProperties: + packageName: unit_test_api diff --git a/bin/configs/r-client.yaml b/bin/configs/r-client.yaml index 9043e19da79..e6d0fca8d62 100644 --- a/bin/configs/r-client.yaml +++ b/bin/configs/r-client.yaml @@ -5,3 +5,7 @@ templateDir: modules/openapi-generator/src/main/resources/r httpUserAgent: PetstoreAgent additionalProperties: packageName: petstore + exceptionPackage: rlang + useRlangExceptionHandling: true + returnExceptionOnFailure: true + errorObjectType: "ModelApiResponse" diff --git a/bin/configs/rust-hyper-petstore.yaml b/bin/configs/rust-hyper-petstore.yaml index c1a2520faa3..0d8ab210f77 100644 --- a/bin/configs/rust-hyper-petstore.yaml +++ b/bin/configs/rust-hyper-petstore.yaml @@ -1,7 +1,7 @@ generatorName: rust outputDir: samples/client/petstore/rust/hyper/petstore library: hyper -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/rust additionalProperties: supportAsync: "false" diff --git a/bin/configs/rust-reqwest-petstore.yaml b/bin/configs/rust-reqwest-petstore.yaml index 119ab61dba3..e107582b217 100644 --- a/bin/configs/rust-reqwest-petstore.yaml +++ b/bin/configs/rust-reqwest-petstore.yaml @@ -1,7 +1,7 @@ generatorName: rust outputDir: samples/client/petstore/rust/reqwest/petstore library: reqwest -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/rust additionalProperties: supportAsync: false diff --git a/bin/configs/spring-boot-3.yaml b/bin/configs/spring-boot-3.yaml new file mode 100644 index 00000000000..5c8b97cdad1 --- /dev/null +++ b/bin/configs/spring-boot-3.yaml @@ -0,0 +1,12 @@ +generatorName: spring +outputDir: samples/openapi3/server/petstore/springboot-3 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + groupId: org.openapitools.openapi3 + documentationProvider: springdoc + artifactId: springboot + snapshotVersion: "true" + useSpringBoot3: true + useBeanValidation: true + hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-virtualan.yaml b/bin/configs/spring-boot-virtualan.yaml index c67ecf980ed..f1ae90fa859 100644 --- a/bin/configs/spring-boot-virtualan.yaml +++ b/bin/configs/spring-boot-virtualan.yaml @@ -4,7 +4,7 @@ library: spring-boot inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: - documentationProvider: springfox + documentationProvider: springdoc apiPackage: org.openapitools.virtualan.api modelPackage: org.openapitools.virtualan.model virtualService: true diff --git a/bin/configs/spring-cloud-3.yaml b/bin/configs/spring-cloud-3.yaml new file mode 100644 index 00000000000..392f4389537 --- /dev/null +++ b/bin/configs/spring-cloud-3.yaml @@ -0,0 +1,13 @@ +generatorName: spring +library: spring-cloud +outputDir: samples/openapi3/client/petstore/spring-cloud-3 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + groupId: org.openapitools.openapi3 + documentationProvider: springdoc + artifactId: spring-cloud-oas3 + useSpringBoot3: "true" + interfaceOnly: "true" + singleContentTypes: "true" + hideGenerationTimestamp: "true" diff --git a/bin/configs/typescript-angular-v10-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v10-provided-in-root-with-npm.yaml deleted file mode 100644 index e94546bca67..00000000000 --- a/bin/configs/typescript-angular-v10-provided-in-root-with-npm.yaml +++ /dev/null @@ -1,10 +0,0 @@ -generatorName: typescript-angular -outputDir: samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular -additionalProperties: - ngVersion: 10.0.0 - npmVersion: 1.0.0 - npmName: '@openapitools/typescript-angular-petstore' - npmRepository: https://skimdb.npmjs.com/registry - snapshot: false diff --git a/bin/configs/typescript-angular-v11-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v11-provided-in-root-with-npm.yaml deleted file mode 100644 index 7e3bcbbf3cb..00000000000 --- a/bin/configs/typescript-angular-v11-provided-in-root-with-npm.yaml +++ /dev/null @@ -1,10 +0,0 @@ -generatorName: typescript-angular -outputDir: samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular -additionalProperties: - ngVersion: 11.0.0 - npmVersion: 1.0.0 - npmName: '@openapitools/typescript-angular-petstore' - npmRepository: https://skimdb.npmjs.com/registry - snapshot: false diff --git a/bin/configs/typescript-angular-v11-provided-in-root.yaml b/bin/configs/typescript-angular-v11-provided-in-root.yaml deleted file mode 100644 index a25b4cbe326..00000000000 --- a/bin/configs/typescript-angular-v11-provided-in-root.yaml +++ /dev/null @@ -1,6 +0,0 @@ -generatorName: typescript-angular -outputDir: samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular -additionalProperties: - ngVersion: 11.0.0 diff --git a/bin/configs/typescript-angular-v11-oneOf.yaml b/bin/configs/typescript-angular-v12-oneOf.yaml similarity index 73% rename from bin/configs/typescript-angular-v11-oneOf.yaml rename to bin/configs/typescript-angular-v12-oneOf.yaml index e86a596865c..7d355b753cb 100644 --- a/bin/configs/typescript-angular-v11-oneOf.yaml +++ b/bin/configs/typescript-angular-v12-oneOf.yaml @@ -1,6 +1,6 @@ generatorName: typescript-angular -outputDir: samples/client/petstore/typescript-angular-v11-oneOf/builds/default +outputDir: samples/client/petstore/typescript-angular-v12-oneOf/builds/default inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml templateDir: modules/openapi-generator/src/main/resources/typescript-angular additionalProperties: - ngVersion: 11.0.0 + ngVersion: 12.2.0 diff --git a/bin/configs/typescript-angular-v9-provided-in-any.yaml b/bin/configs/typescript-angular-v12-provided-in-any.yaml similarity index 67% rename from bin/configs/typescript-angular-v9-provided-in-any.yaml rename to bin/configs/typescript-angular-v12-provided-in-any.yaml index 22bee99305f..3cc0d756b33 100644 --- a/bin/configs/typescript-angular-v9-provided-in-any.yaml +++ b/bin/configs/typescript-angular-v12-provided-in-any.yaml @@ -1,7 +1,7 @@ generatorName: typescript-angular -outputDir: samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default +outputDir: samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/typescript-angular additionalProperties: - ngVersion: 9.0.0 + ngVersion: 12.2.0 providedIn: any diff --git a/bin/configs/typescript-angular-v13-oneOf.yaml b/bin/configs/typescript-angular-v13-oneOf.yaml new file mode 100644 index 00000000000..7bc65fcbddc --- /dev/null +++ b/bin/configs/typescript-angular-v13-oneOf.yaml @@ -0,0 +1,6 @@ +generatorName: typescript-angular +outputDir: samples/client/petstore/typescript-angular-v13-oneOf/builds/default +inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-angular +additionalProperties: + ngVersion: 13.0.1 diff --git a/bin/configs/typescript-angular-v10-provided-in-root.yaml b/bin/configs/typescript-angular-v13-provided-in-any.yaml similarity index 61% rename from bin/configs/typescript-angular-v10-provided-in-root.yaml rename to bin/configs/typescript-angular-v13-provided-in-any.yaml index 65a195cb466..5cf16a7e0ea 100644 --- a/bin/configs/typescript-angular-v10-provided-in-root.yaml +++ b/bin/configs/typescript-angular-v13-provided-in-any.yaml @@ -1,6 +1,7 @@ generatorName: typescript-angular -outputDir: samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default +outputDir: samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/typescript-angular additionalProperties: - ngVersion: 10.0.0 + ngVersion: 13.0.1 + providedIn: any diff --git a/bin/configs/typescript-angular-v9-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v9-provided-in-root-with-npm.yaml deleted file mode 100644 index df3775b9dd9..00000000000 --- a/bin/configs/typescript-angular-v9-provided-in-root-with-npm.yaml +++ /dev/null @@ -1,10 +0,0 @@ -generatorName: typescript-angular -outputDir: samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular -additionalProperties: - ngVersion: 9.0.0 - npmVersion: 1.0.0 - npmName: '@openapitools/typescript-angular-petstore' - npmRepository: https://skimdb.npmjs.com/registry - snapshot: false diff --git a/bin/configs/typescript-angular-v9-provided-in-root.yaml b/bin/configs/typescript-angular-v9-provided-in-root.yaml deleted file mode 100644 index f32176dc72d..00000000000 --- a/bin/configs/typescript-angular-v9-provided-in-root.yaml +++ /dev/null @@ -1,6 +0,0 @@ -generatorName: typescript-angular -outputDir: samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/typescript-angular -additionalProperties: - ngVersion: 9.0.0 diff --git a/bin/generate-samples.sh b/bin/generate-samples.sh index 81c6cc9c6d1..b296ba608f3 100755 --- a/bin/generate-samples.sh +++ b/bin/generate-samples.sh @@ -53,9 +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 - if [ ${#files[@]} -eq 0 ]; then files=("${root}"/bin/configs/*.yaml) fi diff --git a/docs/customization.md b/docs/customization.md index 8606d09f689..e7c7cebc558 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -394,3 +394,51 @@ or ``` --import-mappings Pet=my.models.MyPet --import-mappings Order=my.models.MyOrder ``` + +## Schema Mapping + +One can map the schema to someting else (e.g. external objects/models outside of the package) using the `schemaMappings` option, e.g. 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/type-alias.yaml -o /tmp/java2/ --schema-mapping TypeAlias=foo.bar.TypeAlias +``` +Another example (in conjunction with --type-mappings): +```sh +java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i /tmp/alias.yaml -o /tmp/alias/ --schema-mappings stream=org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody --type-mappings string+binary=stream +``` +while /tmp/alias.yaml is as follows: +```yaml +openapi: 3.0.3 +info: + title: Demo app + version: 1.0.0 +servers: + - url: /api/v1 +paths: + /demo: + get: + summary: Demo + operationId: demo + responses: + '200': + description: Demo response + content: + text/csv: + schema: + type: string + format: binary +``` + +## Inline Schema Naming + +Inline schemas are created as separate schemas automatically and the auto-generated schema name may not look good to everyone. One can customize the name using the `title` field or the `inlineSchemaNameMapping` option, e.g. in CLI + +``` +java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/inline_model_resolver.yaml -o /tmp/java3/ --skip-validate-spec --inline-schema-name-mappings inline_object_2=SomethingMapped,inline_object_4=nothing_new +``` + +Another useful option is `inlineSchemaNameDefaults`, which allows you to customize the suffix of the auto-generated inline schema name, e.g. in CLI +``` +--inline-schema-name-defaults arrayItemSuffix=_array_item +``` + +Note: Only arrayItemSuffix, mapItemSuffix are supported at the moment. diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index f8a95fbb597..c4dc4acb6d5 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools| |packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library| |packageVersion|C# package version.| |1.0.0| +|pocoModels|Build POCO Models| |false| |returnICollection|Return ICollection<T> instead of the concrete type.| |false| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src| diff --git a/docs/generators/cpp-qt-client.md b/docs/generators/cpp-qt-client.md index 3e8027011ea..c7da6c1da09 100644 --- a/docs/generators/cpp-qt-client.md +++ b/docs/generators/cpp-qt-client.md @@ -38,6 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Type/Alias | Imports | | ---------- | ------- | |OAIHttpFileElement|#include "OAIHttpFileElement.h"| +|QJsonValue|#include <QJsonValue>| ## INSTANTIATION TYPES diff --git a/docs/generators/cpp-ue4.md b/docs/generators/cpp-ue4.md index 7c514088e22..d80c179ff81 100644 --- a/docs/generators/cpp-ue4.md +++ b/docs/generators/cpp-ue4.md @@ -54,6 +54,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • TArray
  • TArray<uint8>
  • TMap
  • +
  • TSet
  • TSharedPtr<FJsonObject>
  • TSharedPtr<FJsonValue>
  • bool
  • diff --git a/docs/generators/haskell.md b/docs/generators/haskell.md index 1b1e3e68c13..59cef6a6bde 100644 --- a/docs/generators/haskell.md +++ b/docs/generators/haskell.md @@ -29,6 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |serveStatic|serve will serve files from the directory 'static'.| |true| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|useCustomMonad|use a custom monad instead of the default Handler| |false| ## IMPORT MAPPING @@ -195,7 +196,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |BasicAuth|✓|OAS2,OAS3 |ApiKey|✓|OAS2,OAS3 |OpenIDConnect|✗|OAS3 -|BearerToken|✗|OAS3 +|BearerToken|✓|OAS3 |OAuth2_Implicit|✓|OAS2,OAS3 |OAuth2_Password|✗|OAS2,OAS3 |OAuth2_ClientCredentials|✗|OAS2,OAS3 diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 69d3472e489..e8f88e8269e 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -80,7 +80,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| |serializableModel|boolean - toggle "implements Serializable" for generated models| |false| |singleContentTypes|Whether to select only one produces/consumes content-type by operation.| |false| -|skipDefaultInterface|Whether to generate default implementations for java8 interfaces| |false| +|skipDefaultInterface|Whether to skip generation of default implementations for java8 interfaces| |false| |snapshotVersion|Uses a SNAPSHOT version.|
    **true**
    Use a SnapShot Version
    **false**
    Use a Release Version
    |null| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| @@ -91,6 +91,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useBeanValidation|Use BeanValidation API annotations| |true| |useFeignClientUrl|Whether to generate Feign client with url parameter.| |true| |useOptional|Use Optional container for optional parameters| |false| +|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports).| |true| |useSpringController|Annotate the generated API as a Spring Controller| |false| |useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true| |useTags|use tags for creating interface and controller classnames| |false| diff --git a/docs/generators/java.md b/docs/generators/java.md index 65645070598..2427013b0e2 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -85,6 +85,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useRuntimeException|Use RuntimeException instead of Exception| |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| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## SUPPORTED VENDOR EXTENSIONS diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 02289613d8a..473ee4ec3dd 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -26,10 +26,12 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| |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|
    **jvm-ktor**
    Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).
    **jvm-okhttp4**
    [DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
    **jvm-okhttp3**
    Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.
    **jvm-retrofit2**
    Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
    **multiplatform**
    Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.
    **jvm-volley**
    Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9
    |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| |omitGradlePluginVersions|Whether to declare Gradle plugin versions in build files.| |false| +|omitGradleWrapper|Whether to omit Gradle wrapper for creating a sub project.| |false| |packageName|Generated artifact package name.| |org.openapitools.client| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|
    **toJson**
    [DEFAULT] Date formatter option using a json converter.
    **toString**
    Use the 'toString'-method of the date-time object to retrieve the related string representation.
    |toJson| diff --git a/docs/generators/perl.md b/docs/generators/perl.md index 34b9e1354a2..090ccadf142 100644 --- a/docs/generators/perl.md +++ b/docs/generators/perl.md @@ -41,7 +41,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl