diff --git a/.circleci/config.yml b/.circleci/config.yml index bcf8db2b1586..2f05fb9a72ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -204,8 +204,8 @@ jobs: - command_build_and_test: nodeNo: "3" node4: - docker: - - image: fkrull/multi-python + machine: + image: ubuntu-2004:202201-02 working_directory: ~/OpenAPITools/openapi-generator shell: /bin/bash --login environment: @@ -215,7 +215,7 @@ jobs: DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli steps: - checkout - - command_docker_build_and_test: + - command_build_and_test: nodeNo: "4" workflows: version: 2 diff --git a/.github/.test/samples.json b/.github/.test/samples.json index 4d9f501e1446..9d960634ec3b 100644 --- a/.github/.test/samples.json +++ b/.github/.test/samples.json @@ -319,12 +319,6 @@ "Client: Java" ] }, - { - "input": "java-petstore-jersey1.sh", - "matches": [ - "Client: Java" - ] - }, { "input": "java-petstore-jersey2-java6.sh", "matches": [ @@ -584,18 +578,6 @@ "Server: Java" ] }, - { - "input": "jaxrs-jersey1-petstore-server.sh", - "matches": [ - "Server: Java" - ] - }, - { - "input": "jaxrs-jersey1-usetags-petstore-server.sh", - "matches": [ - "Server: Java" - ] - }, { "input": "jaxrs-petstore-server-datelib-j8.sh", "matches": [ @@ -800,12 +782,6 @@ "Client: Python" ] }, - { - "input": "python-server-flask-petstore-python2.sh", - "matches": [ - "Server: Python" - ] - }, { "input": "python-server-flask-petstore.sh", "matches": [ diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 53ff1e59ded1..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` (6.3.0) (minor release - 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` (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/docker.yaml b/.github/workflows/docker.yaml index 2c00a7ae28ac..b52ce072c0d5 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Test run-in-docker.sh shell: bash diff --git a/.github/workflows/gradle-plugin-tests.yaml b/.github/workflows/gradle-plugin-tests.yaml index d9c383c44172..fdf278761b01 100644 --- a/.github/workflows/gradle-plugin-tests.yaml +++ b/.github/workflows/gradle-plugin-tests.yaml @@ -13,7 +13,7 @@ jobs: name: Gradle plugin tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 11 uses: actions/setup-java@v3 with: diff --git a/.github/workflows/gradle-test.yaml b/.github/workflows/gradle-test.yaml index 923073d5bc46..2746851ca013 100644 --- a/.github/workflows/gradle-test.yaml +++ b/.github/workflows/gradle-test.yaml @@ -30,7 +30,7 @@ jobs: - samples/client/petstore/java/okhttp-gson-group-parameter - samples/client/petstore/java/webclient-swagger2 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 15c80ef1e4a1..c57a41dc0043 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -20,7 +20,7 @@ jobs: os: [ubuntu-latest] steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v3 @@ -45,7 +45,7 @@ jobs: ${{ runner.os }}-gradle- - name: Setup Maven - uses: s4u/setup-maven-action@v1.8.0 + uses: s4u/setup-maven-action@v1.10.0 with: java-version: ${{ matrix.java }} maven-version: 3.8.8 @@ -85,9 +85,9 @@ jobs: os: [ubuntu-latest] steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Maven - uses: s4u/setup-maven-action@v1.8.0 + uses: s4u/setup-maven-action@v1.10.0 with: java-version: 11 maven-version: 3.8.8 diff --git a/.github/workflows/maven-plugin-tests.yaml b/.github/workflows/maven-plugin-tests.yaml index d7e61733e0c8..fe46066a3351 100644 --- a/.github/workflows/maven-plugin-tests.yaml +++ b/.github/workflows/maven-plugin-tests.yaml @@ -13,7 +13,7 @@ jobs: name: Maven plugin tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 11 uses: actions/setup-java@v3 with: diff --git a/.github/workflows/misc-test.yaml b/.github/workflows/misc-test.yaml index d359aab4b293..e561489642a2 100644 --- a/.github/workflows/misc-test.yaml +++ b/.github/workflows/misc-test.yaml @@ -15,7 +15,7 @@ jobs: name: Misc tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: '2.6' diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index fe213843dc57..5fb9a9c4cb6e 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -15,7 +15,7 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 11 uses: actions/setup-java@v3 with: @@ -53,7 +53,7 @@ jobs: needs: - build steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 11 uses: actions/setup-java@v3 with: @@ -90,7 +90,7 @@ jobs: needs: - build steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 11 uses: actions/setup-java@v3 with: @@ -129,7 +129,7 @@ jobs: - build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 11 uses: actions/setup-java@v3 with: diff --git a/.github/workflows/samples-c-libcurl-client.yaml b/.github/workflows/samples-c-libcurl-client.yaml index 3756cb0b164d..79f2b286dce3 100644 --- a/.github/workflows/samples-c-libcurl-client.yaml +++ b/.github/workflows/samples-c-libcurl-client.yaml @@ -13,7 +13,7 @@ jobs: name: Build c libcurl client runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Prepare run: | sudo apt-get update diff --git a/.github/workflows/samples-cpp-qt-client.yaml b/.github/workflows/samples-cpp-qt-client.yaml index e1e6e4e5dc44..a01af2c0298c 100644 --- a/.github/workflows/samples-cpp-qt-client.yaml +++ b/.github/workflows/samples-cpp-qt-client.yaml @@ -28,7 +28,7 @@ jobs: tools: 'tools_openssl_x64' runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: jurplel/install-qt-action@v3 with: version: ${{ matrix.qt-version }} diff --git a/.github/workflows/samples-dart.yaml b/.github/workflows/samples-dart.yaml index fdbdb94f9216..b6095e56c412 100644 --- a/.github/workflows/samples-dart.yaml +++ b/.github/workflows/samples-dart.yaml @@ -17,7 +17,7 @@ jobs: name: Tests Dart runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-dotnet-standard.yaml b/.github/workflows/samples-dotnet-standard.yaml index 47c4124b0f37..cde1955e6931 100644 --- a/.github/workflows/samples-dotnet-standard.yaml +++ b/.github/workflows/samples-dotnet-standard.yaml @@ -18,7 +18,7 @@ jobs: # clients - samples/client/petstore/csharp/OpenAPIClient-generichost-netstandard2.0 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: 3.1.* diff --git a/.github/workflows/samples-dotnet.yaml b/.github/workflows/samples-dotnet.yaml index 2b8905f4f332..8ee577de2c86 100644 --- a/.github/workflows/samples-dotnet.yaml +++ b/.github/workflows/samples-dotnet.yaml @@ -42,7 +42,7 @@ jobs: - samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse - samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: '7.0.x' diff --git a/.github/workflows/samples-dotnet6-client-echo-api.yaml b/.github/workflows/samples-dotnet6-client-echo-api.yaml index 8b07b3686007..a0dcb8a58c2a 100644 --- a/.github/workflows/samples-dotnet6-client-echo-api.yaml +++ b/.github/workflows/samples-dotnet6-client-echo-api.yaml @@ -18,7 +18,7 @@ jobs: # clients - samples/client/echo_api/csharp-restsharp/ steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: '6.0.x' @@ -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-dotnet6-client.yaml b/.github/workflows/samples-dotnet6-client.yaml index 75776062e1be..fdfbdab7db55 100644 --- a/.github/workflows/samples-dotnet6-client.yaml +++ b/.github/workflows/samples-dotnet6-client.yaml @@ -72,7 +72,7 @@ jobs: # build C# API client (property, parameter name mappings) - samples/client/petstore/csharp-restsharp-name-parameter-mappings steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: '6.0.x' diff --git a/.github/workflows/samples-dotnet6-server.yaml b/.github/workflows/samples-dotnet6-server.yaml index 6f91443ad1aa..ea8a278a0327 100644 --- a/.github/workflows/samples-dotnet6-server.yaml +++ b/.github/workflows/samples-dotnet6-server.yaml @@ -29,7 +29,7 @@ jobs: - samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse - samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: '6.0.x' diff --git a/.github/workflows/samples-elm.yaml b/.github/workflows/samples-elm.yaml index 364cafbea822..33f6f1200004 100644 --- a/.github/workflows/samples-elm.yaml +++ b/.github/workflows/samples-elm.yaml @@ -21,7 +21,7 @@ jobs: - samples/client/petstore/elm - samples/openapi3/client/elm steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: jorelali/setup-elm@v5 with: elm-version: 0.19.1 diff --git a/.github/workflows/samples-erlang.yaml b/.github/workflows/samples-erlang.yaml index fb339e224e92..c9e0981e49c4 100644 --- a/.github/workflows/samples-erlang.yaml +++ b/.github/workflows/samples-erlang.yaml @@ -26,7 +26,7 @@ jobs: - samples/client/petstore/erlang-client/ - samples/client/petstore/erlang-proper/ steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: otp-version: '22.2' diff --git a/.github/workflows/samples-go.yaml b/.github/workflows/samples-go.yaml index 4c6ea3e11dcd..55446d513bb9 100644 --- a/.github/workflows/samples-go.yaml +++ b/.github/workflows/samples-go.yaml @@ -24,7 +24,7 @@ jobs: - samples/server/petstore/go-api-server/ - samples/server/petstore/go-chi-server/ steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: "stable" diff --git a/.github/workflows/samples-groovy.yaml b/.github/workflows/samples-groovy.yaml index e9c1f791aad9..fd735ae7a9df 100644 --- a/.github/workflows/samples-groovy.yaml +++ b/.github/workflows/samples-groovy.yaml @@ -21,7 +21,7 @@ jobs: sample: - samples/client/petstore/groovy steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-haskell.yaml b/.github/workflows/samples-haskell.yaml new file mode 100644 index 000000000000..a1d7d3940fc3 --- /dev/null +++ b/.github/workflows/samples-haskell.yaml @@ -0,0 +1,36 @@ +name: Samples Haskell + +on: + push: + paths: + - samples/server/petstore/haskell-yesod/** + - samples/server/petstore/haskell-servant/** + - samples/client/petstore/haskell-http-client/** + pull_request: + paths: + - samples/server/petstore/haskell-yesod/** + - samples/server/petstore/haskell-servant/** + - samples/client/petstore/haskell-http-client/** +jobs: + build: + name: Build stack projects + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # servers + - samples/server/petstore/haskell-yesod/ + - samples/server/petstore/haskell-servant/ + - samples/client/petstore/haskell-http-client/ + steps: + - uses: actions/checkout@v4 + - uses: haskell/actions/setup@v2 + with: + # ghc-version: '8.8.4' # Exact version of ghc to use + # cabal-version: 'latest'. Omitted, but defaults to 'latest' + enable-stack: true + stack-version: 'latest' + - name: stack test + working-directory: ${{ matrix.sample }} + run: stack test diff --git a/.github/workflows/samples-java-client-echo-api-jdk11.yaml b/.github/workflows/samples-java-client-echo-api-jdk11.yaml index 12813b635003..be449320325e 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk11.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk11.yaml @@ -20,7 +20,7 @@ jobs: - samples/client/echo_api/java/native - samples/client/echo_api/java/feign-gson steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-java-client-echo-api-jdk8.yaml b/.github/workflows/samples-java-client-echo-api-jdk8.yaml index 42a220e658d3..1529b1de61ff 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk8.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk8.yaml @@ -24,7 +24,7 @@ jobs: - samples/client/echo_api/java/feign-gson - samples/client/echo_api/java/okhttp-gson steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-java-client-jdk11.yaml b/.github/workflows/samples-java-client-jdk11.yaml index 8faeac0841e9..8977db230f34 100644 --- a/.github/workflows/samples-java-client-jdk11.yaml +++ b/.github/workflows/samples-java-client-jdk11.yaml @@ -10,6 +10,8 @@ on: - samples/openapi3/client/petstore/java/jersey2-java8-swagger1/** - samples/openapi3/client/petstore/java/jersey2-java8-swagger2/** - samples/openapi3/client/petstore/java/native** + - samples/client/others/java/resttemplate-useAbstractionForFiles/** + - samples/client/others/java/webclient-useAbstractionForFiles/** pull_request: paths: - 'samples/client/petstore/java/**' @@ -19,6 +21,8 @@ on: - samples/openapi3/client/petstore/java/jersey2-java8-swagger1/** - samples/openapi3/client/petstore/java/jersey2-java8-swagger2/** - samples/openapi3/client/petstore/java/native** + - samples/client/others/java/resttemplate-useAbstractionForFiles/** + - samples/client/others/java/webclient-useAbstractionForFiles/** jobs: build: name: Build Java Client JDK11 @@ -43,15 +47,16 @@ jobs: - samples/client/petstore/java/webclient-swagger2 - samples/client/petstore/java/vertx - samples/client/petstore/java/jersey2-java8-localdatetime - - samples/client/petstore/java/resteasy - samples/client/petstore/java/google-api-client - samples/client/petstore/java/rest-assured - samples/client/petstore/java/rest-assured-jackson - samples/client/petstore/java/microprofile-rest-client - samples/client/petstore/java/microprofile-rest-client-3.0 + - samples/client/petstore/java/microprofile-rest-client-3.0-jackson + - samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml - samples/client/petstore/java/apache-httpclient - samples/client/petstore/java/feign - - samples/client/petstore/java/jersey1 + - samples/client/petstore/java/okhttp-gson-awsv4signature - samples/openapi3/client/petstore/java/jersey2-java8-special-characters - samples/openapi3/client/petstore/java/native - samples/client/petstore/java/okhttp-gson-swagger1/ @@ -60,8 +65,10 @@ jobs: - samples/client/petstore/java/okhttp-gson-swagger2/ - samples/client/petstore/java/resttemplate-swagger2/ - samples/openapi3/client/petstore/java/jersey2-java8-swagger2/ + - samples/client/others/java/resttemplate-useAbstractionForFiles/ + - samples/client/others/java/webclient-useAbstractionForFiles/ steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-java-client-jdk17.yaml b/.github/workflows/samples-java-client-jdk17.yaml index 0e4bbf2c3ae5..afaa76e0c68d 100644 --- a/.github/workflows/samples-java-client-jdk17.yaml +++ b/.github/workflows/samples-java-client-jdk17.yaml @@ -21,7 +21,7 @@ jobs: - samples/client/petstore/java/resttemplate-jakarta - samples/client/petstore/java/webclient-jakarta steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-java-helidon.yaml b/.github/workflows/samples-java-helidon.yaml index 1bdc5b4ae5eb..abc22170f3c6 100644 --- a/.github/workflows/samples-java-helidon.yaml +++ b/.github/workflows/samples-java-helidon.yaml @@ -23,7 +23,7 @@ jobs: - samples/server/petstore/java-helidon-server/se version: [17] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-java-play-framework.yaml b/.github/workflows/samples-java-play-framework.yaml index 083f003073e7..17cf0c678516 100644 --- a/.github/workflows/samples-java-play-framework.yaml +++ b/.github/workflows/samples-java-play-framework.yaml @@ -29,7 +29,7 @@ jobs: - samples/server/petstore/java-play-framework-no-swagger-ui - samples/server/petstore/java-play-framework-no-wrap-calls steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-java-server-jdk8.yaml b/.github/workflows/samples-java-server-jdk8.yaml index ead0a70eccfa..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,9 +30,9 @@ 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@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-jaxrs-jdk11.yaml b/.github/workflows/samples-jaxrs-jdk11.yaml new file mode 100644 index 000000000000..f97f134ba979 --- /dev/null +++ b/.github/workflows/samples-jaxrs-jdk11.yaml @@ -0,0 +1,36 @@ +name: Samples JAX-RS (JDK11) + +on: + push: + paths: + - samples/server/petstore/jaxrs/jersey3/** + pull_request: + paths: + - samples/server/petstore/jaxrs/jersey3/** +jobs: + build: + name: Build JAX-RS + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # servers + - samples/server/petstore/jaxrs/jersey3 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 11 + - 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-jaxrs.yaml b/.github/workflows/samples-jaxrs.yaml index 65c1a871d7d2..744216754463 100644 --- a/.github/workflows/samples-jaxrs.yaml +++ b/.github/workflows/samples-jaxrs.yaml @@ -26,8 +26,6 @@ jobs: - samples/server/petstore/jaxrs-spec - samples/server/petstore/jaxrs-spec-interface - samples/server/petstore/jaxrs-spec-interface-response - - samples/server/petstore/jaxrs/jersey1 - - samples/server/petstore/jaxrs/jersey1-useTags - samples/server/petstore/jaxrs-datelib-j8 - samples/server/petstore/jaxrs-resteasy/default - samples/server/petstore/jaxrs-resteasy/eap @@ -40,7 +38,7 @@ jobs: - samples/server/petstore/jaxrs-cxf-non-spring-app - samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-jdk17.yaml b/.github/workflows/samples-jdk17.yaml index ceb2b84ac930..e264ec628a5b 100644 --- a/.github/workflows/samples-jdk17.yaml +++ b/.github/workflows/samples-jdk17.yaml @@ -45,7 +45,7 @@ jobs: - samples/client/petstore/spring-http-interface-reactive - samples/client/petstore/spring-http-interface steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-julia.yaml b/.github/workflows/samples-julia.yaml index bf3d209ad03a..b692a6b4a5f5 100644 --- a/.github/workflows/samples-julia.yaml +++ b/.github/workflows/samples-julia.yaml @@ -15,7 +15,7 @@ jobs: name: Tests Julia runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: 1.8 diff --git a/.github/workflows/samples-kotlin-client.yaml b/.github/workflows/samples-kotlin-client.yaml index 9fe322623d79..ba36425e2cf2 100644 --- a/.github/workflows/samples-kotlin-client.yaml +++ b/.github/workflows/samples-kotlin-client.yaml @@ -4,9 +4,11 @@ on: push: branches: - 'samples/client/petstore/kotlin*/**' + - 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**' pull_request: paths: - 'samples/client/petstore/kotlin*/**' + - 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**' env: GRADLE_VERSION: 6.9 @@ -49,6 +51,7 @@ jobs: - samples/client/petstore/kotlin-array-simple-string-multiplatform - samples/client/petstore/kotlin-bigdecimal-default-multiplatform - samples/client/petstore/kotlin-bigdecimal-default-okhttp4 + - samples/client/petstore/kotlin-jvm-jackson - samples/client/petstore/kotlin-jvm-ktor-jackson - samples/client/petstore/kotlin-jvm-ktor-gson - samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization @@ -60,8 +63,9 @@ jobs: - samples/client/petstore/kotlin-jvm-spring-3-webclient - samples/client/petstore/kotlin-spring-cloud - samples/client/petstore/kotlin-name-parameter-mappings + - samples/client/others/kotlin-jvm-okhttp-parameter-tests steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-kotlin-server-jdk17.yaml b/.github/workflows/samples-kotlin-server-jdk17.yaml index 099330f5b21a..44e918ded1f2 100644 --- a/.github/workflows/samples-kotlin-server-jdk17.yaml +++ b/.github/workflows/samples-kotlin-server-jdk17.yaml @@ -4,9 +4,13 @@ on: push: branches: - 'samples/server/petstore/kotlin-springboot-3*/**' + # comment out due to gradle build failure + # - samples/server/petstore/kotlin-spring-default/** pull_request: paths: - 'samples/server/petstore/kotlin-springboot-3*/**' + # comment out due to gradle build failure + # - samples/server/petstore/kotlin-spring-default/** env: GRADLE_VERSION: 7.4 @@ -21,8 +25,10 @@ jobs: sample: # server - samples/server/petstore/kotlin-springboot-3 + # comment out due to gradle build failure + # - samples/server/petstore/kotlin-spring-default/ steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-kotlin-server.yaml b/.github/workflows/samples-kotlin-server.yaml index 3fbafa1d09be..61fbccaeadd8 100644 --- a/.github/workflows/samples-kotlin-server.yaml +++ b/.github/workflows/samples-kotlin-server.yaml @@ -3,10 +3,16 @@ name: Samples Kotlin server on: push: branches: + - samples/server/others/kotlin-server/jaxrs-spec/** - 'samples/server/petstore/kotlin*/**' + # comment out due to gradle build failure + #- samples/server/petstore/kotlin-spring-default/** pull_request: paths: + - samples/server/others/kotlin-server/jaxrs-spec/** - 'samples/server/petstore/kotlin*/**' + # comment out due to gradle build failure + # - samples/server/petstore/kotlin-spring-default/** env: GRADLE_VERSION: 6.9 @@ -31,10 +37,13 @@ jobs: - samples/server/petstore/kotlin-server/jaxrs-spec - samples/server/petstore/kotlin-server/jaxrs-spec-mutiny - samples/server/petstore/kotlin-server-modelMutable + - samples/server/others/kotlin-server/jaxrs-spec + # comment out due to gradle build failure + #- samples/server/petstore/kotlin-spring-default # no build.gradle file #- samples/server/petstore/kotlin-vertx-modelMutable steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-php7.yaml b/.github/workflows/samples-php7.yaml index f675345bff58..54b50e8c03ab 100644 --- a/.github/workflows/samples-php7.yaml +++ b/.github/workflows/samples-php7.yaml @@ -18,7 +18,7 @@ jobs: # servers - samples/server/petstore/php-laravel/lib/ steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP with tools uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/samples-php8.yaml b/.github/workflows/samples-php8.yaml index b9bb97a33d7b..82ead5c953a6 100644 --- a/.github/workflows/samples-php8.yaml +++ b/.github/workflows/samples-php8.yaml @@ -18,7 +18,7 @@ jobs: # servers - samples/server/petstore/php-symfony/SymfonyBundle-php/ steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP with tools uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/samples-python-client-echo-api.yaml b/.github/workflows/samples-python-client-echo-api.yaml new file mode 100644 index 000000000000..38b1f24ad93b --- /dev/null +++ b/.github/workflows/samples-python-client-echo-api.yaml @@ -0,0 +1,44 @@ +name: Python Client (Echo API) + +on: + pull_request: + paths: + - samples/client/echo_api/python/** + - .github/workflows/samples-python-client-echo-api.yaml +jobs: + build: + name: Test Python client + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # clients + - samples/client/echo_api/python + - samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true + python-version: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Setup node.js + uses: actions/setup-node@v3 + - name: Run echo server + run: | + git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server + (cd http-echo-server && npm install && npm start &) + - name: Install + working-directory: ${{ matrix.sample }} + run: | + pip install -r requirements.txt + pip install -r test-requirements.txt + + - name: Test + working-directory: ${{ matrix.sample }} + run: python -m pytest diff --git a/.github/workflows/samples-python-nextgen-client-echo-api.yaml b/.github/workflows/samples-python-nextgen-client-echo-api.yaml deleted file mode 100644 index 29ea147eef1d..000000000000 --- a/.github/workflows/samples-python-nextgen-client-echo-api.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: Python Client (Echo API) - -on: - push: - paths: - - samples/client/echo_api/python/** - pull_request: - paths: - - samples/client/echo_api/python/** -jobs: - build: - name: Test Python client - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - sample: - # clients - - samples/client/echo_api/python - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.7' - - name: Setup node.js - uses: actions/setup-node@v3 - - name: Run echo server - run: | - git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server - (cd http-echo-server && npm install && npm start &) - - name: Install - working-directory: ${{ matrix.sample }} - run: | - pip install -r requirements.txt - pip install -r test-requirements.txt - - name: Test - working-directory: ${{ matrix.sample }} - run: python -m pytest diff --git a/.github/workflows/samples-python-petstore.yaml b/.github/workflows/samples-python-petstore.yaml new file mode 100644 index 000000000000..21c80cc42db6 --- /dev/null +++ b/.github/workflows/samples-python-petstore.yaml @@ -0,0 +1,59 @@ +name: "Python Client: Petstore" + +on: + pull_request: + paths: + - samples/openapi3/client/petstore/python-aiohttp/** + - samples/openapi3/client/petstore/python/** + - .github/workflows/samples-python-petstore.yaml + +jobs: + build: + name: Test Python client + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + sample: + - samples/openapi3/client/petstore/python-aiohttp + - samples/openapi3/client/petstore/python + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + id: py + with: + python-version: ${{ matrix.python-version }} + + - name: Cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-python-${{ steps.py.outputs.python-version }}- + path: | + ~/.cache/pypoetry/virtualenvs/ + ~/.local/pipx/venvs/poetry/ + .mypy_cache/ + + - name: Install poetry + run: pipx install --python '${{ steps.py.outputs.python-path }}' poetry + + - name: Install + working-directory: ${{ matrix.sample }} + run: poetry install + + - name: Test + working-directory: ${{ matrix.sample }} + run: poetry run pytest -v diff --git a/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml b/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml new file mode 100644 index 000000000000..32950c686acb --- /dev/null +++ b/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml @@ -0,0 +1,44 @@ +name: Python Client pydantic v1 (Echo API) + +on: + pull_request: + paths: + - samples/client/echo_api/python-pydantic-v1/** + - .github/workflows/samples-python-pydantic-v1-client-echo-api.yaml + +jobs: + build: + name: Test Python client + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # clients + - samples/client/echo_api/python-pydantic-v1/ + python-version: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Setup node.js + uses: actions/setup-node@v3 + - name: Run echo server + run: | + git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server + (cd http-echo-server && npm install && npm start &) + - name: Install + working-directory: ${{ matrix.sample }} + run: | + pip install -r requirements.txt + pip install -r test-requirements.txt + + - name: Test + working-directory: ${{ matrix.sample }} + run: python -m pytest diff --git a/.github/workflows/samples-python-pydantic-v1-petstore.yaml b/.github/workflows/samples-python-pydantic-v1-petstore.yaml new file mode 100644 index 000000000000..ce5c1265d3ea --- /dev/null +++ b/.github/workflows/samples-python-pydantic-v1-petstore.yaml @@ -0,0 +1,59 @@ +name: "Python Client pydantic v1: Petstore" + +on: + pull_request: + paths: + - samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/** + - samples/openapi3/client/petstore/python-pydantic-v1/** + - .github/workflows/samples-python-pydantic-v1-petstore.yaml + +jobs: + build: + name: Test Python client + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + sample: + - samples/openapi3/client/petstore/python-pydantic-v1-aiohttp + - samples/openapi3/client/petstore/python-pydantic-v1 + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + id: py + with: + python-version: ${{ matrix.python-version }} + + - name: Cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-python-${{ steps.py.outputs.python-version }}- + path: | + ~/.cache/pypoetry/virtualenvs/ + ~/.local/pipx/venvs/poetry/ + .mypy_cache/ + + - name: Install poetry + run: pipx install --python '${{ steps.py.outputs.python-path }}' poetry + + - name: Install + working-directory: ${{ matrix.sample }} + run: poetry install + + - name: Test + working-directory: ${{ matrix.sample }} + run: poetry run pytest -v diff --git a/.github/workflows/samples-python-server.yaml b/.github/workflows/samples-python-server.yaml index 52d04ff07c78..4ff5ca98c629 100644 --- a/.github/workflows/samples-python-server.yaml +++ b/.github/workflows/samples-python-server.yaml @@ -18,7 +18,7 @@ jobs: # servers - samples/server/petstore/python-aiohttp/ steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: '3.7' diff --git a/.github/workflows/samples-rust.yaml b/.github/workflows/samples-rust.yaml index 420da4d75993..02d885611d6c 100644 --- a/.github/workflows/samples-rust.yaml +++ b/.github/workflows/samples-rust.yaml @@ -25,7 +25,7 @@ jobs: - samples/client/petstore/rust/ - samples/server/petstore/rust-server/ steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: toolchain: stable diff --git a/.github/workflows/samples-scala.yaml b/.github/workflows/samples-scala.yaml index 0d71f743d67b..29fa8d8f3bbc 100644 --- a/.github/workflows/samples-scala.yaml +++ b/.github/workflows/samples-scala.yaml @@ -27,10 +27,11 @@ jobs: - samples/server/petstore/scala-lagom-server - samples/server/petstore/scala-play-server - samples/server/petstore/scala-akka-http-server + - samples/server/petstore/scala-pekko-http-server - samples/server/petstore/scalatra - samples/server/petstore/scala-finch # cannot be tested with jdk11 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-spring-jdk17.yaml b/.github/workflows/samples-spring-jdk17.yaml index f962bb0d6204..9c594477a268 100644 --- a/.github/workflows/samples-spring-jdk17.yaml +++ b/.github/workflows/samples-spring-jdk17.yaml @@ -18,7 +18,7 @@ jobs: # clients - samples/openapi3/client/petstore/spring-cloud-3-with-optional steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index cfe1bb4b053c..8baf85b44b63 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -3,10 +3,16 @@ name: Samples Java Spring on: push: paths: + # clients + - 'samples/client/petstore/spring*/**' + # servers - 'samples/server/petstore/spring*/**' - 'samples/openapi3/server/petstore/spring*/**' pull_request: paths: + # clients + - 'samples/client/petstore/spring*/**' + # servers - 'samples/server/petstore/spring*/**' - 'samples/openapi3/server/petstore/spring*/**' jobs: @@ -27,12 +33,14 @@ jobs: - samples/openapi3/client/petstore/spring-cloud-async - samples/openapi3/client/petstore/spring-cloud-spring-pageable - samples/client/petstore/spring-cloud-tags + - samples/client/petstore/spring-cloud-deprecated # servers - samples/server/petstore/springboot - samples/openapi3/server/petstore/springboot - samples/server/petstore/springboot-beanvalidation - samples/server/petstore/springboot-useoptional - samples/server/petstore/springboot-reactive + - samples/server/petstore/springboot-reactive-noResponseEntity - samples/server/petstore/springboot-implicitHeaders - samples/openapi3/server/petstore/springboot-implicitHeaders - samples/server/petstore/springboot-delegate @@ -47,8 +55,9 @@ jobs: - samples/server/petstore/springboot-spring-pageable-delegatePattern - samples/server/petstore/springboot-spring-pageable-without-j8 - samples/server/petstore/springboot-spring-pageable + - samples/server/petstore/springboot-spring-provide-args steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'temurin' diff --git a/.github/workflows/samples-swift.yaml b/.github/workflows/samples-swift.yaml new file mode 100644 index 000000000000..94f440953e25 --- /dev/null +++ b/.github/workflows/samples-swift.yaml @@ -0,0 +1,50 @@ +name: Samples Swift + +on: + push: + paths: + - samples/client/petstore/swift5/** + pull_request: + paths: + - samples/client/petstore/swift5/** + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [macos-latest] + sample: + - samples/client/petstore/swift5/alamofireLibrary + - samples/client/petstore/swift5/anycodableLibrary + - samples/client/petstore/swift5/asyncAwaitLibrary + - samples/client/petstore/swift5/combineLibrary + - samples/client/petstore/swift5/default + - samples/client/petstore/swift5/deprecated + - samples/client/petstore/swift5/frozenEnums + - samples/client/petstore/swift5/nonPublicApi + - samples/client/petstore/swift5/objcCompatible + - samples/client/petstore/swift5/oneOf + - samples/client/petstore/swift5/promisekitLibrary + - samples/client/petstore/swift5/readonlyProperties + - samples/client/petstore/swift5/resultLibrary + - samples/client/petstore/swift5/rxswiftLibrary + - samples/client/petstore/swift5/urlsessionLibrary + - samples/client/petstore/swift5/validation + # NOTE: disabled as vaporLibrary doesnt build when adding this CI config + #- samples/client/petstore/swift5/vaporLibrary + - samples/client/petstore/swift5/x-swift-hashable + include: + - os: ubuntu-latest + sample: samples/client/petstore/swift5/alamofireLibrary + name: Build Swift samples + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: swift-actions/setup-swift@v1 + if: ${{ matrix.os == 'ubuntu-latest' }} + with: + swift-version: '5' + - name: Build + working-directory: ${{ matrix.sample }} + run: swift build \ No newline at end of file diff --git a/.github/workflows/samples-zapier.yaml b/.github/workflows/samples-zapier.yaml index 728ebbfd291a..859721bdd3ff 100644 --- a/.github/workflows/samples-zapier.yaml +++ b/.github/workflows/samples-zapier.yaml @@ -18,7 +18,7 @@ jobs: sample: - samples/client/petstore/zapier steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup node uses: actions/setup-node@v3 - name: Install dependencies diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index ba1e07f603e8..4f3bf722a3fe 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest if: ${{ github.repository_owner == 'OpenAPITools' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 11 uses: actions/setup-java@v3 with: diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index db43b979283c..27d151cc86d7 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -18,7 +18,7 @@ jobs: matrix: java: [11, 17] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v3 with: @@ -39,7 +39,7 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- - name: Setup Maven - uses: s4u/setup-maven-action@v1.8.0 + uses: s4u/setup-maven-action@v1.10.0 with: java-version: ${{ matrix.java }} maven-version: 3.8.8 diff --git a/.gitignore b/.gitignore index 1be33afa8852..ab086a35e068 100644 --- a/.gitignore +++ b/.gitignore @@ -49,8 +49,6 @@ nb-configuration.xml /target /generated-files test-output/ -nbactions.xml -test-output/ # website website/build/ @@ -73,7 +71,6 @@ samples/client/petstore/build samples/client/petstore/cpp-qt/PetStore/moc_* samples/client/petstore/cpp-qt/PetStore/*.o samples/client/petstore/cpp-qt/build-* -samples/client/petstore/cpp-qt/build-* samples/client/petstore/cpp-qt/PetStore/PetStore samples/client/petstore/cpp-qt/PetStore/Makefile samples/client/petstore/cpp-qt/PetStore/PetStore.pro.user @@ -89,7 +86,7 @@ samples/client/petstore/cpp-restsdk/cmake_install.cmake **/.gradle samples/client/petstore/java/hello.txt samples/client/petstore/java/okhttp-gson/hello.txt -samples/client/petstore/java/jersey1/hello.txt +samples/client/petstore/java/okhttp-gson-3.1/hello.txt samples/client/petstore/java/jersey2-java8/hello.txt samples/client/petstore/java/jersey2/hello.txt samples/client/petstore/android/default/hello.txt @@ -100,9 +97,7 @@ samples/client/petstore/java/jersey2/build/ samples/client/petstore/java/okhttp-gson/.gradle/ samples/client/petstore/java/okhttp-gson/build/ samples/client/petstore/java/feign/build/ -samples/client/petstore/java/feign10x/build/ samples/client/petstore/java/feign/project/ -samples/client/petstore/java/feign10x/project/ samples/client/petstore/java/retrofit/build/ samples/client/petstore/java/retrofit2/build/ samples/client/petstore/java/retrofit2/hello.txt @@ -110,7 +105,6 @@ samples/client/petstore/java/retrofit2rx/build/ samples/client/petstore/java/default/build/ samples/client/petstore/scala/build/ samples/client/petstore/java/resttemplate/hello.txt -samples/client/petstore/java/retrofit2/hello.txt samples/client/petstore/java/feign/hello.txt samples/client/petstore/java/jersey2-java6/project/ samples/client/petstore/java/jersey2-java8/project/ @@ -173,17 +167,17 @@ samples/client/petstore/csharp-refactor/OpenAPIClient/nuget.exe # Python *.pyc __pycache__ +.venv/ samples/client/petstore/python/dev-requirements.txt.log samples/client/petstore/python/swagger_client.egg-info/SOURCES.txt samples/client/petstore/python/.coverage samples/client/petstore/python/.projectile -samples/client/petstore/python/.venv/ -samples/client/petstore/python-asyncio/.venv/ samples/client/petstore/python-asyncio/.pytest_cache/ -samples/client/petstore/python-tornado/.venv/ + # PHP samples/client/petstore/php/OpenAPIClient-php/composer.lock +samples/client/petstore/php-nextgen/OpenAPIClient-php/composer.lock samples/client/petstore/php-dt/composer.lock samples/client/petstore/php-dt-modern/composer.lock samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/composer.lock @@ -193,6 +187,7 @@ samples/server/petstore/php-slim4/composer.lock samples/server/petstore/php-symfony/SymfonyBundle-php/composer.lock samples/server/petstore/php-mezzio-ph/composer.lock samples/server/petstore/php-mezzio-ph-modern/composer.lock +samples/client/petstore/php-nextgen/OpenAPIClient-php/.phplint.cache/ # ts samples/client/petstore/typescript-angular2/npm/npm-debug.log @@ -211,6 +206,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 @@ -270,6 +266,7 @@ samples/client/petstore/c/*.so # Ruby samples/openapi3/client/petstore/ruby/Gemfile.lock samples/openapi3/client/petstore/ruby-faraday/Gemfile.lock +samples/openapi3/client/petstore/ruby-httpx/Gemfile.lock # Crystal samples/client/petstore/crystal/lib 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/.travis.yml b/.travis.yml index 97a20b0a728a..306c1da810a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -136,7 +136,7 @@ script: # run integration tests defined in maven pom.xml # WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet. # show "error" only to reduce the log size - - ./mvnw -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -DskipTests -Dmaven.javadoc.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error 2>&1 | grep -i error + - ./mvnw -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -DskipTests -Dmaven.javadoc.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error after_success: # push to maven repo - if [ $SONATYPE_USERNAME ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 4ccb585afed5..b5baa82c9604 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -9,15 +9,6 @@ set -e export NODE_ENV=test -function cleanup { - # Show logs of 'petstore.swagger' container to troubleshoot Unit Test failures, if any. - if [ "$NODE_INDEX" != "4" ]; then - docker logs petstore.swagger # container name specified in circle.yml - fi -} - -trap cleanup EXIT - if [ "$NODE_INDEX" = "1" ]; then echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..." java -version diff --git a/README.md b/README.md index 23ee2d660900..75e63f56d1e8 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@
-[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.0.0`): +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.1.0`): [![Build Status](https://api.travis-ci.com/OpenAPITools/openapi-generator.svg?branch=master&status=passed)](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds) [![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) @@ -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.
    |true| -|library|library template (sub-template)|
    **jersey1**
    Jersey core 1.x
    **jersey2**
    Jersey core 2.x
    |jersey2| +|library|library template (sub-template)|
    **jersey2**
    Jersey core 2.x
    |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